c# override class name where x-parser-schema-id is present #1510
-
I'm generating my first c# models from an AsyncAPI document. The AsyncAPI document has many occurrences of the x-parser-schema-id property, all set to anonymous-schema-. The models generated are using this the value of x-parser-schema-id, which will be confusing to use and we would prefer to use the name property. How can we configure this? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
To more accurately define names for models in your AsyncAPI document, you can set the You can also overwrite the naming constrainer: https://modelina.org/examples?selectedExample=overwrite-naming-formatting |
Beta Was this translation helpful? Give feedback.
@3p05 I think there are two ways forward here.
1st one is that you want
message.name
to be used as the root payload model name, right? If that is the case please create a feature request 🙂2nd you want to have further control over
what
value is selected as the model name in the first place, i.e. in this case you don't wantx-parser-schema-id
but something else. I would create another feature request for this as well 🙂Furthermore, the AsyncAPI document you have access to really is not optimal for code generation. Cause we have to use best effort to try and guess the names for the generated models, because one was not provided in the schema. Whoever is the owner of the document needs to ch…