API: Duplication of endpoints / Missing documentation #17066
Labels
severity: low
Does not significantly disrupt application functionality, or a workaround is available
status: accepted
This issue has been accepted for implementation
topic: OpenAPI
type: bug
A confirmed report of unexpected behavior in the application
Deployment Type
Self-hosted
NetBox Version
v4.0.2
Python Version
3.11
Steps to Reproduce
Observe identical example output and parameters of GET, PUT and PATCH on endpoint
/api/extras/scripts/{id}/
from the Swagger UI: https://demo.netbox.dev/api/schema/swagger-ui/#/extras/extras_scripts_updateExpected Behavior
I would assume that I could upload a new script, by PUTing on the endpoint shown in the documentation or updating an existing script by PATCHing.
I don't know if this is derived by #16670 or someplace else (or even the intended behaviour), but it seems poorly documented.
Observed Behavior
The parameters for all three request types are identical, and produce (as far as I can tell) the same output, making them redundant.
Example output from swagger for PUT
/api/extras/scripts/{id}/
:Example output from swagger for GET
/api/extras/scripts/{id}/
:The
diff
between the two seems negligible:I was looking for an endpoint to upload custom scripts without using the GUI but got stuck here hoping for some clarification.
TL;DR I cannot tell what the POST and PATCH endpoints are used for (
/api/extras/scripts/{id}/
), as both the parameters, as well as the return object, seem identical with GET.I would expect that PUT should take a request body, where I can include a script that I wish to upload, like the request bodies required for PUTing on the other endpoints in the API.
The text was updated successfully, but these errors were encountered: