[PR #13353] [MERGED] Feature - Schema Generation #14166

Closed
opened 2025-12-29 23:22:58 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/13353
Author: @danner26
Created: 8/2/2023
Status: Merged
Merged: 8/11/2023
Merged by: @jeremystretch

Base: developHead: issue-10030-buildschema


📝 Commits (10+)

  • 6fc4b7e Schema generation is working
  • d42626b Added option to either dump to a file or the console
  • cdd3bc3 Moving schema file and utilizing settings definition for file paths
  • 71983ad Cleaning up the imports and fixing a few pythonic issues
  • ebca49f Tweak command flags
  • 22ecc96 Clean up choices mapping
  • b699c7b Misc cleanup
  • c75211d Rename & move template file
  • b556e9c Move management command from extras to dcim
  • c4bf3ca Update release checklist

📊 Changes

4 files changed (+726 additions, -0 deletions)

View changed files

contrib/generated_schema.json (+561 -0)
📝 docs/development/release-checklist.md (+10 -0)
netbox/dcim/management/commands/buildschema.py (+62 -0)
netbox/templates/extras/schema/devicetype_schema.jinja2 (+93 -0)

📄 Description

Fixes: #10030

Added manage.py subcommand (buildschema) to build a valid schema file for the devicetype-library. Data within this file will be used directly within the validation schema to ensure choices are synced properly between both repositories. Future revisions of this will be utilized with GitHub Actions to automatically update the devicetype-library (or alternatively we will write the schema to this repository and pull it on the fly).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/13353 **Author:** [@danner26](https://github.com/danner26) **Created:** 8/2/2023 **Status:** ✅ Merged **Merged:** 8/11/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `issue-10030-buildschema` --- ### 📝 Commits (10+) - [`6fc4b7e`](https://github.com/netbox-community/netbox/commit/6fc4b7e7567bba7b97e5819148e98a310e371d7c) Schema generation is working - [`d42626b`](https://github.com/netbox-community/netbox/commit/d42626b7f8db4d5569ada6169bdef37fdc84e9f4) Added option to either dump to a file or the console - [`cdd3bc3`](https://github.com/netbox-community/netbox/commit/cdd3bc31ba798745cb3047328c1afca5ece3184b) Moving schema file and utilizing settings definition for file paths - [`71983ad`](https://github.com/netbox-community/netbox/commit/71983ad84ebbdb737a3dd9a6038fedf9699c5768) Cleaning up the imports and fixing a few pythonic issues - [`ebca49f`](https://github.com/netbox-community/netbox/commit/ebca49f8e3924f7931999dd4dcc3f27bf2a6a54e) Tweak command flags - [`22ecc96`](https://github.com/netbox-community/netbox/commit/22ecc96de20318727fb92d6223d4a92770e1fdba) Clean up choices mapping - [`b699c7b`](https://github.com/netbox-community/netbox/commit/b699c7bd9862a77d1081feaffbbc931d8d5b9a42) Misc cleanup - [`c75211d`](https://github.com/netbox-community/netbox/commit/c75211d10064e96b3cf25db092c75fc7e8f977d0) Rename & move template file - [`b556e9c`](https://github.com/netbox-community/netbox/commit/b556e9c40eaffe3e7dca5029e3671bf02f78e26a) Move management command from extras to dcim - [`c4bf3ca`](https://github.com/netbox-community/netbox/commit/c4bf3ca3f4a725ef849e4fabe2369a3d5cd91e21) Update release checklist ### 📊 Changes **4 files changed** (+726 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `contrib/generated_schema.json` (+561 -0) 📝 `docs/development/release-checklist.md` (+10 -0) ➕ `netbox/dcim/management/commands/buildschema.py` (+62 -0) ➕ `netbox/templates/extras/schema/devicetype_schema.jinja2` (+93 -0) </details> ### 📄 Description Fixes: #10030 Added `manage.py` subcommand (`buildschema`) to build a valid schema file for the devicetype-library. Data within this file will be used directly within the validation schema to ensure choices are synced properly between both repositories. Future revisions of this will be utilized with GitHub Actions to automatically update the devicetype-library (or alternatively we will write the schema to this repository and pull it on the fly). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 23:22:58 +01:00
adam closed this issue 2025-12-29 23:22:58 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14166