You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current discussion is that we support the latest YANG model version and work backwards but need to ensure editor support and things like intellisense will return the correct model using an editor like VSCode to improve the developer experience.
Folder structure for implementing various versions should follow python naming conventions so for example lets take the openconfig-vlan YANG model. The latest revision as of today is @2023-02-07.
Building a model from a netdantic user perspective may look a little like this:
from netdantic.models.openconfig import vlan as oc_vlan
vlan = oc_vlan()
vlan.config.vlan_id = 10
vlan.config.name = "VLAN-10"
Automatically the openconfig VLAN model should use the latest YANG version unless specified by a user within the root pydantic model, eg. oc_vlan(vlan_id=10, version="2021-07-28"). This example may not work properly unless we can find a way to ensure the editor uses the correct pydantic class or we can just ensure that if anyone wants to use an earlier YANG model, they explicitly import the class from the version folder and we make sure all the latest models are exposed at the top level so the import statements look clean.
The text was updated successfully, but these errors were encountered:
The current discussion is that we support the latest YANG model version and work backwards but need to ensure editor support and things like intellisense will return the correct model using an editor like VSCode to improve the developer experience.
Folder structure for implementing various versions should follow python naming conventions so for example lets take the openconfig-vlan YANG model. The latest revision as of today is @2023-02-07.
Folder structure example
Building a model from a netdantic user perspective may look a little like this:
Automatically the openconfig VLAN model should use the latest YANG version unless specified by a user within the root pydantic model, eg.
oc_vlan(vlan_id=10, version="2021-07-28")
. This example may not work properly unless we can find a way to ensure the editor uses the correct pydantic class or we can just ensure that if anyone wants to use an earlier YANG model, they explicitly import the class from the version folder and we make sure all the latest models are exposed at the top level so the import statements look clean.The text was updated successfully, but these errors were encountered: