Skip to content

spring: add annotation if property name endsWith("FOO")> #4877

@adhamhf

Description

@adhamhf
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:

        if( property.baseName.endsWith("FOO") ) {
            property.example = "true";
        }

    {{#example}}@Id{{/example}}
    private {{{datatypeWithEnum}}} {{name}} = {{{defaultValue}}};

Is there a better way to do this?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions