You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then based on checking the params in netbox.openapi()['paths']['/api/ipam/prefixes/']['get']['parameters'] it could be determined that the parameter foo does not exist.
There would be a slight performance penalty due to retrieving the (rather large) OpenAPI schema, but that can be done once on startup.
Glancing at the pynetbox code, perhaps the validation can be done in Endpoint.filter() after the dict of filters has been determined and before creating the Request object. To not break existing applications, this validation could default to being disabled, and enabled by an extra boolean in Api.__init__.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all, thank you for maintaining this library!
I think that validating URL parameters could be a useful feature for the pynetbox client.
For example, if a call like this is made:
Then based on checking the params in
netbox.openapi()['paths']['/api/ipam/prefixes/']['get']['parameters']
it could be determined that the parameterfoo
does not exist.There would be a slight performance penalty due to retrieving the (rather large) OpenAPI schema, but that can be done once on startup.
Glancing at the pynetbox code, perhaps the validation can be done in
Endpoint.filter()
after the dict offilters
has been determined and before creating theRequest
object. To not break existing applications, this validation could default to being disabled, and enabled by an extra boolean inApi.__init__
.Hoping to hear your opinions on this.
Beta Was this translation helpful? Give feedback.
All reactions