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
Given a schema, it would be very interesting to allow certain objects from being rendered to the final csharp code. This could allow users to pass objects that, as long as share the same name with an already defined class, could be used as a reference.
To make this work we would need:
A custom tag to allow the generator to skip the rendering of this objects (similar to x-Abstract)
A way to inject using statements at the top of the generated field
The text was updated successfully, but these errors were encountered:
The alternative is to start keeping a record of sgen-related extension tags. This strategy is in fact covered by the OpenAPI spec, as well as adopted by several other tools.
I thus propose to use the x-sgen-namespace tag. This tag would be of type string and would be used to append a namespace to the class. On automatic code creation, if a class is a namespace, the generator would only create references but not the class itself (nor its constructor). The generator could also leverage all the unique namespaces in the schema and append them to the top of the file as using statements. To prevent name clashing, we could also just render the full namespace.class name in the generated file.
Since NJsonSchema does not have hooks to other flags, we will likely need to add a preprocessing step to the schema ingestion.
Given a schema, it would be very interesting to allow certain objects from being rendered to the final csharp code. This could allow users to pass objects that, as long as share the same name with an already defined class, could be used as a reference.
To make this work we would need:
using
statements at the top of the generated fieldThe text was updated successfully, but these errors were encountered: