-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenAPI schema is incorrect for the ipam_prefixes_available-prefixes_create
endpoint
#11729
Comments
This looks like it is still an issue for OpenAPI 3, but blocked till #9608 gets in. |
@Gaardsholt I don't think this is actually a bug. prefix_length is the only valid field to pass for available_prefixes. By default DRF (which is used to create the API endpoints) by default doesn't error on extra fields passed in (see: https://stackoverflow.com/questions/22178266/django-rest-framework-raise-error-when-extra-fields-are-present-on-post). You could open a feature request to enable this (but should be done on all APIs, not just this one) if this is a problem. Closing for now. |
@arthanson I guess it shouldn't error on the extra fields? |
As Gaardsholt said this is incorrect. available_prefixes accepts and persists all prefix fields as far as I can tell. Simple payload as this shows it: https://demo.netbox.dev/api/ipam/prefixes/98/available-prefixes/
|
I think this was my mistake. I told @arthanson that |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide. |
It seems that since the 3.6 release, the documentation has been updated for this API, but now it is missing the |
NetBox version
v3.4.5-dev
Python version
3.9
Steps to Reproduce
/api/docs/
/ipam/prefixes/{id}/available-prefixes/
endpointprefix_length
in the bodyExpected Behavior
That I can use all the fields set on a prefix.
I have successfully tested with the following fields:
Observed Behavior
That the API docs shows all the available fields that I can set.
I have been playing around with it locally, so I will be happy to do a pull request for it.
The text was updated successfully, but these errors were encountered: