You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
#9276 implemented "readOnly" by generating the annotation "JsonProperty.Access.READ_ONLY".
readOnly (OpenAPI): a property which can be sent in a response but not in a request.
JsonProperty.Access.READ_ONLY: property is ignored on deserialization.
These are differnet things. So on reading a response, properties marked as readOnly are not deserialized by jackson and are always null. This breaks all schemas that contain readOnly-properties because those properties are never deserialized. The same is probably true for writeOnly when trying to read requests.
Might be I simply don't understand something here, but how are you supposed to use this? Dont use readOnly? Create separate schemas for server and client?
Bug Report Checklist
Description
#9276 implemented "readOnly" by generating the annotation "JsonProperty.Access.READ_ONLY".
readOnly (OpenAPI): a property which can be sent in a response but not in a request.
JsonProperty.Access.READ_ONLY: property is ignored on deserialization.
These are differnet things. So on reading a response, properties marked as readOnly are not deserialized by jackson and are always null. This breaks all schemas that contain readOnly-properties because those properties are never deserialized. The same is probably true for writeOnly when trying to read requests.
Might be I simply don't understand something here, but how are you supposed to use this? Dont use readOnly? Create separate schemas for server and client?
openapi-generator version
5.2.1
Related issues/PRs
#9222
Suggest a fix
Don't generate "JsonProperty.Access.READ_ONLY" because it has different semantics from OpenAPI's "readOnly".
The text was updated successfully, but these errors were encountered: