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
Do you have ideas for how to support readOnly and writeOnly properties, where readOnly properties are omitted from POST, PUT, PATCH, etc., and writeOnly properties are omitted from GET? I've documented the current behavior below.
I think that, ideally the generated TypeBox schemas would have some way to be evaluated in the context of a "read" or "write" operation, which would result in certain properties being omitted. But I'm not sure (1) if that's something TypeBox should do, or (2) something @geut/openapi-box should do. IIUC, it's OpenAPI which extends the semantics of readOnly and writeOnly, and so should @geut/openapi-box be the one to handle this?
I'm using TypeSpec to generate OpenAPI schemas, and @geut/openapi-box for converting those to TypeBox. TypeSpec generates schemas using readOnly and writeOnly (which is quite handy for reducing the size of the OpenAPI schema); however, I've yet to find a tool, at least in the TypeScript ecosystem, that handles this well. Because of that, I've had to avoid using readOnly and writeOnly in my OpenAPI schemas (related TypeSpec issue).
The text was updated successfully, but these errors were encountered:
Very nice tool! Thank you :-)
Do you have ideas for how to support
readOnly
andwriteOnly
properties, wherereadOnly
properties are omitted from POST, PUT, PATCH, etc., andwriteOnly
properties are omitted from GET? I've documented the current behavior below.I think that, ideally the generated TypeBox schemas would have some way to be evaluated in the context of a "read" or "write" operation, which would result in certain properties being omitted. But I'm not sure (1) if that's something TypeBox should do, or (2) something @geut/openapi-box should do. IIUC, it's OpenAPI which extends the semantics of
readOnly
andwriteOnly
, and so should @geut/openapi-box be the one to handle this?Given this schema…
@geut/openapi-box generates…
Background
I'm using TypeSpec to generate OpenAPI schemas, and @geut/openapi-box for converting those to TypeBox. TypeSpec generates schemas using
readOnly
andwriteOnly
(which is quite handy for reducing the size of the OpenAPI schema); however, I've yet to find a tool, at least in the TypeScript ecosystem, that handles this well. Because of that, I've had to avoid usingreadOnly
andwriteOnly
in my OpenAPI schemas (related TypeSpec issue).The text was updated successfully, but these errors were encountered: