-
Notifications
You must be signed in to change notification settings - Fork 190
Complete models, or add type stubs #758
Description
pynetbox version
v7.6.1
NetBox version
v4.5
Feature type
Data model extension
Proposed functionality
Create stubs for models, for use with type checkers like mypy.
https://github.com/interdotlink/pynetbox-stubs did exist but has been archived/deprecated.
They point to https://github.com/koxudaxi/datamodel-code-generator but it seems this isn't alone a solution.
TraceableRecords, i.e. cables, can go between many object types.
And records like IpAddresses can be assigned to i.e. Devices or VMs. datamodel-code-generator alone can't work this out so just points to Any:
https://github.com/interdotlink/pynetbox-stubs could be resurrected, but using datamodel-code-generator to stay up-to-date. Additional work will be needed, i.e. for TraceableRecords especially.
This may also be a chance to uplift Models and reduce the usage of generic Record types, i.e. for Racks.
Stubs would ultimately be unnecessary if complete models were generated; perhaps even allowing for changes to fit a specific API spec via a commandline tool.
Use case
There's currently no typing information available to type checkers for most properties:
This would resolve that
External dependencies
No response