Open joheredi opened 2 years ago
I think option 1 would provide a better experience overall since it could be set in the swagger which would remove the need for any transforms at all. This would probably be interesting for other languages as well
It took me a lot of time to arrive at this thread. It would be great if this was documented better in the official docs. My config looked like this:
modelerfour:
lenient-model-deduplication: true
naming:
override:
_id: _id
And I was frustrated that it is not working. After reading this thread, I changed it to:
modelerfour:
lenient-model-deduplication: true
naming:
override:
_id: $DO_NOT_NORMALIZE$_id
And it works!
Thanks for the feedback @MarcErdmann.
@sarangan12, would you mind adding this to the documentation?
Currently, if we need to keep a name as described in the swagger that doesn't conform to modeler four namer config, for example if we want a property
key_ops
in the generated code, to avoid the generator making itkeyOps
we'd need to set a complex transform (see example)I think this can be improved in 2 different ways
1) Have a new extension in the Swagger
x-ms-keep-name
which if set to true, M4 would not pass it through the namer. 2) Even if we don't implement the new extension, if we stop doing custom case conversion inautorest.typescript
(see this comment for context) I think we could reduce the transform to the following?