-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [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?
openapi-generator version
5.2.1
Related issues/PRs
Suggest a fix
Don't generate "JsonProperty.Access.READ_ONLY" because it has different semantics from OpenAPI's "readOnly".