color must be hexa-lowercase (in rack-roles) #3623

Closed
opened 2025-12-29 18:30:13 +01:00 by adam · 1 comment
Owner

Originally created by @hchybz on GitHub (Apr 30, 2020).

Environment

  • Python version: Not Used
  • NetBox version: netbox (v2.7.10)
  • CURL : simplest test

Steps to Reproduce

  1. No python needed
  2. just a simple CURL POST command
  3. curl -X POST "http://mynetbox.home/api/dcim/rack-roles/" -d '{ "name": "Spare2", "slug": "spare2", "color": "089abC", "description": "Spare Rack 2" }'

==> color names are not (yet) supported, neither "#00ff44", at leat "00FF44"
==> should be OK : html colors are accepted both in lowercase/uppercase
==> should accept html syntax with # or colorname

{
"id": 16,
"name": "Spare2",
"slug": "spare2",
"color": "089abC",
"description": "Spare Rack 2"
}

Observed Behavior

{
"color": [
"Enter a valid hexadecimal RGB color code."
]

Originally created by @hchybz on GitHub (Apr 30, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report, and that any plugins have been disabled. --> ### Environment * Python version: Not Used * NetBox version: netbox (v2.7.10) * CURL : simplest test <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox. Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a client library such as pynetbox. --> ### Steps to Reproduce 1. No python needed 2. just a simple CURL POST command 3. curl -X POST "http://mynetbox.home/api/dcim/rack-roles/" -d '{ "name": "Spare2", "slug": "spare2", "color": "089abC", "description": "Spare Rack 2" }' <!-- What did you expect to happen? --> ==> color names are not (yet) supported, neither "#00ff44", at leat "00FF44" ==> should be OK : html colors are accepted both in lowercase/uppercase ==> should accept html syntax with # or colorname { "id": 16, "name": "Spare2", "slug": "spare2", "color": "089abC", "description": "Spare Rack 2" } <!-- What happened instead? --> ### Observed Behavior { "color": [ "Enter a valid hexadecimal RGB color code." ]
adam closed this issue 2025-12-29 18:30:13 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 30, 2020):

This is expected behavior. Only lowercase hexadecimal RGB codes are accepted. There is no need to change this.

@jeremystretch commented on GitHub (Apr 30, 2020): This is expected behavior. Only lowercase hexadecimal RGB codes are accepted. There is no need to change this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3623