Skip to content

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

@jeremystretch

Description

@jeremystretch

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.)

Metadata

Metadata

Assignees

Labels

status: acceptedThis issue has been accepted for implementationtype: housekeepingChanges to the application which do not directly impact the end user

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions