Add pre-commit check for changes to OpenAPI schema #11544

Closed
opened 2025-12-29 21:46:36 +01:00 by adam · 0 comments
Owner

Originally created by @jeremystretch on GitHub (Aug 29, 2025).

Originally assigned to: @jeremystretch on GitHub.

Proposed Changes

  1. Commit a static copy of NetBox's OpenAPI schema (the JSON data published at /api/schema/)*
  2. Introduce a pre-commit check that regenerates this file and fails if any changes are detected

* Use of this static file for other purposes should be discouraged as it is limited to the base API schema, and does not include any plugins installed in the user's own NetBox deployment.

Justification

The goal here is to implement a check for NetBox's OpenAPI schema to mitigate unexpected changes. Should the pre-commit check fail, the author will need to either update the schema as part of the commit, or make adjustments to avoid the unexpected change. (Changes are generally anticipated only for breaking releases.)

Originally created by @jeremystretch on GitHub (Aug 29, 2025). Originally assigned to: @jeremystretch on GitHub. ### Proposed Changes 1. Commit a static copy of NetBox's OpenAPI schema (the JSON data published at `/api/schema/`)\* 2. Introduce a `pre-commit` check that regenerates this file and fails if any changes are detected \* Use of this static file for other purposes should be discouraged as it is limited to the base API schema, and does not include any plugins installed in the user's own NetBox deployment. ### Justification The goal here is to implement a check for NetBox's OpenAPI schema to mitigate unexpected changes. Should the pre-commit check fail, the author will need to either update the schema as part of the commit, or make adjustments to avoid the unexpected change. (Changes are generally anticipated only for breaking releases.)
adam added the status: acceptedtype: housekeeping labels 2025-12-29 21:46:36 +01:00
adam closed this issue 2025-12-29 21:46:36 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11544