We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The attribute parameters readOnly and writeOnly are ignored when generating jackson JsonProperty annotation.
readOnly
writeOnly
JsonProperty
5.0.1
"Example": { "type": "object", "properties": { "displayName_r": { "type": "string", "readOnly": true }, "displayName_w": { "type": "string", "writeOnly": true } } },
<generatorName>jaxrs-spec</generatorName> <configOptions> <interfaceOnly>true</interfaceOnly> <returnResponse>false</returnResponse> <sourceFolder>java</sourceFolder> <useSwaggerAnnotations>false</useSwaggerAnnotations> <generatePom>false</generatePom> <dateLibrary>java8</dateLibrary> </configOptions>
Example.java
access
none
Update pojo.mustache to use @JsonProperty(value = "{{baseName}}"{{#isReadOnly}}, access = JsonProperty.Access.READ_ONLY{{/isReadOnly}}{{#isWriteOnly}}, access = JsonProperty.Access.WRITE_ONLY{{/isWriteOnly}}) instead of @JsonProperty("{{baseName}}")
pojo.mustache
@JsonProperty(value = "{{baseName}}"{{#isReadOnly}}, access = JsonProperty.Access.READ_ONLY{{/isReadOnly}}{{#isWriteOnly}}, access = JsonProperty.Access.WRITE_ONLY{{/isWriteOnly}})
@JsonProperty("{{baseName}}")
The text was updated successfully, but these errors were encountered:
Was integrated via #9276
Sorry, something went wrong.
No branches or pull requests
Bug Report Checklist
Description
The attribute parameters
readOnly
andwriteOnly
are ignored when generating jacksonJsonProperty
annotation.openapi-generator version
5.0.1
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Example.java
-> usages ofJsonProperty
do not defineaccess
Related issues/PRs
none
Suggest a fix
Update
pojo.mustache
to use@JsonProperty(value = "{{baseName}}"{{#isReadOnly}}, access = JsonProperty.Access.READ_ONLY{{/isReadOnly}}{{#isWriteOnly}}, access = JsonProperty.Access.WRITE_ONLY{{/isWriteOnly}})
instead of
@JsonProperty("{{baseName}}")
The text was updated successfully, but these errors were encountered: