Open adhamhf opened 7 years ago
@adhamhf not sure if I understand it correctly, do you mean JSON-API requires @Id in all the payload/object?
@wing328 yes, it requires id ( not @id that's just the java annotation ) when you are reading, updating or deleting objects. It is not required for creating new objects.
@adhamhf another way I can think of is using vendor extensions with customized templates.
{{#example}}@Id{{/example}}
private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};
Description
Swagger-codegen version
2.2.2-SNAPSHOT
Help/feature request
I'm writing a new generator for Spring and JSON-API. I'm using the https://github.com/jasminb/jsonapi-converter to generate JSON-API from our models.
JSON-API requires an ID in the payload, the jsonapi-converter uses its @Id annotation to specify which field should be used as the ID in the payload.
Currently I have this hacked solution in place:
Is there a better way to do this?
Thanks!