Where should we store models? #637
darrelmiller
started this conversation in
Ideas
Replies: 1 comment
-
models namespace under the main namespace specified as argument to the generator |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Today we attempt to place models at the root of the tree that uses the model. This causes a problem if new usage of the model higher in the tree causes the model to be generated at a new location. This would be a breaking change.
Instead of doing this, we are proposing to place all models generated from /components/schemas in the models folder. Components that have names with dots will use the dotted segments as namespaces under the models folder. If the schema namespace prefix matches the namespace passed in the commandline, this namespace will be stripped from the model name to prevent duplicate namespaces.
e.g. when generating the Microsoft Graph with Microsoft.Graph as the namespace passed to the commandline and a component schema named microsoft.graph.user, the model will be created at Microsoft.Graph.Models.User.
However, if the namespace is passed to Kiota is "Sdk" the model will be created as Sdk.Models.Microsoft.Graph.User
Beta Was this translation helpful? Give feedback.
All reactions