-
-
Notifications
You must be signed in to change notification settings - Fork 533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
required and readyOnly/writeOnly properties #432
Comments
@stefanprobst you might be right, it could be that this is not taken into account |
"If the property is marked as readOnly being true and is in the required list, the required will take effect on the response only." So here is a bug now, we generated readOnly+required field as required in requestBody. :) |
For omitting read-only I recommend using a utility type for typescript. It could be placed for any request. I use this utility type export type OmitReadonly<T extends object> = Omit<T, ReadonlyKeys<T>>
In the end generating a function like this: postCommentsArticle(
article: string,
requestBody?: (OmitReadonly<Comment> & {
/**
* Email of the author
*/
email: string;
}),
){} |
hi, i'm curious how this library handles the contextual behavior of
required
properties interacting withreadOnly
/writeOnly
?from https://swagger.io/specification
i have tried with the following example, and it looks like marking the property as
readonly
does not fully capture the above behavior?Example
The text was updated successfully, but these errors were encountered: