netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Public demo: https://demo.netbox.dev
http://netboxlabs.com/oss/netbox/
Apache License 2.0
15.37k stars 2.49k forks source link

Missing api documentation for "POST /api/extras/scripts/" request #16731

Open ngotzmann opened 1 week ago

ngotzmann commented 1 week ago

Deployment Type

Self-hosted

NetBox Version

v4.0.5

Python Version

3.11

Steps to Reproduce

  1. Go to https://demo.netbox.dev/api/schema/swagger-ui/#/extras/extras_scripts_create or your self hosted 1.1. Under "Parameters", you will notice there are no parameters

  2. Trying to call the api endpoint without body, will result in an error (who would have expected this :smile: )

  3. I used following curl command:

    curl -X 'POST' \
    'https://netbox/api/extras/scripts/' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -H "Authorization: Token XXX" \
    -d ''

Expected Behavior

Having all fields available on this endpoint documented

Observed Behavior

{
  "error": "null value in column \"module_id\" of relation \"extras_script\" violates not-null constraint\nDETAIL:  Failing row contains (19, , null, t).",
  "exception": "IntegrityError",
  "netbox_version": "4.0.5",
  "python_version": "3.11.2"
}
jeffgdotorg commented 1 week ago

Thanks for reporting a problem in NetBox.

I've reproduced the problem in a fresh install of NetBox v4.0.6. With a little bit of lateral exploring I'm finding the lack of parameter documentation is not unique to extras/scripts; for example, extras_tags_create also lacks parameter documentation, though POSTing to that endpoint with an empty body provides useful feedback rather than an internal server error.

I'm moving your issue out of triage and into needs owner status. If you or another developer with the requisite skills and capacity would like to work it through to a PR, please say so and a maintainer will assign the issue to you.