File tree Expand file tree Collapse file tree
docs/modules/ROOT/pages/processor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,4 +103,38 @@ which is finally the bulky `BookInlineResponse200`.
103103Apart from the generated name it will have exactly the same content (i.e. properties &
104104setter/getter) since the schema description is identical.
105105
106+ == `readOnly` /`writeOnly`
107+
108+ Using `readOnly`/`writeOnly` on object schema properties
109+
110+ [source,yaml]
111+ ----
112+ Foo:
113+ type: object
114+ properties:
115+ barRead:
116+ readOnly: true
117+ allOf:
118+ - $ref: '#/components/schemas/Bar'
119+ barWrite:
120+ writeOnly: true
121+ allOf:
122+ - $ref: '#/components/schemas/Bar'
123+ ----
124+
125+ will translate to `@JsonProperty` annotations with read-only or write-only `access`:
126+
127+ [source,java]
128+ ----
129+ public class Foo {
130+
131+ @JsonProperty(value = "barRead", access = JsonProperty.Access.READ_ONLY)
132+ private Bar barRead;
133+
134+ @JsonProperty(value = "barWrite", access = JsonProperty.Access.WRITE_ONLY)
135+ private Bar barWrite;
136+
137+ // ....
138+ }
139+ ----
106140
You can’t perform that action at this time.
0 commit comments