Expand description
The request shape and the response shape that readOnly and writeOnly
describe.
OpenAPI marks a property readOnly when a response carries it and a request
must not, and writeOnly for the opposite. The mark names a direction, not a
value, so one struct cannot state both.
Each model therefore drops the properties that its direction does not carry.
A model that one direction reaches keeps its name. A model that both
directions reach becomes <Name>Request and <Name>Response, and so does
every model that both directions reach and that references it.
docs/design.md states the rest of the reasoning.
Constants§
- REQUEST_
SUFFIX - The suffix the request shape of a split model takes.
- RESPONSE_
SUFFIX - The suffix the response shape of a split model takes.
Functions§
- projected_
name - The name a model takes in one direction.
- split_
by_ direction - Project every model a direction mark reaches onto the direction that carries it, and point each API position at the shape it takes.