datamodel-code-generator icon indicating copy to clipboard operation
datamodel-code-generator copied to clipboard

Use title for generating the names of objects inside anyOf/oneOf

Open gaborbernat opened this issue 4 years ago • 3 comments
trafficstars

Currently the root key is used, but this has the side effect of elements being named as RootItem1, RootItem2, etc 👍

gaborbernat avatar Aug 06 '21 13:08 gaborbernat

@gaborbernat Thank you for your great idea. I think we can use the idea for other types like array, enum, etc. What do you think about it?

I will expect to add a new CLI option for the idea. Because I wouldn't like to break the current behavior.

koxudaxi avatar Aug 09 '21 17:08 koxudaxi

Sounds great to me :+1:

gaborbernat avatar Aug 09 '21 18:08 gaborbernat

@gaborbernat
I added --use-title-as-name option to version 0.11.12. Would you please check it?

koxudaxi avatar Aug 27 '21 16:08 koxudaxi