Skip to content

Commit b157a02

Browse files
committed
improve docs
1 parent 802596d commit b157a02

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

docs/modules/ROOT/pages/processor/models.adoc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,38 @@ which is finally the bulky `BookInlineResponse200`.
103103
Apart from the generated name it will have exactly the same content (i.e. properties &
104104
setter/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

0 commit comments

Comments
 (0)