Open
Description
Deployment Type
Self-hosted
NetBox Version
v4.2.3
Python Version
3.10
Steps to Reproduce
- Go to the NetBox UI and navigate to the Regions section.
Create a new region:Name: Hong Kong, Slug: HK
- After creation, create a child region from the UI with the following details:
Name: Hong Kong,Slug: HK (or any valid unique slug),Parent: Hong Kong (the region created in step 1)
- Observe that this is allowed and saved successfully.
- Now, attempt the same operation using the API:
Make a POST request to /api/dcim/regions/ with this payload:
{
"name": "Hong Kong",
"slug": "hk-kong",
"parent": <id_of_Hong_Kong_region_created_in _step_1>
}
Expected Behavior
The child region with the same name (Hong Kong) but a different slug should be created successfully under the parent Hong Kong, matching the behavior observed in the UI.
Observed Behavior
The API returns a 400 Bad Request with an error indicating that the name must be unique or conflicts with the parent, even though the UI allows it.