-
-
Notifications
You must be signed in to change notification settings - Fork 284
Labels
feature 🚀Feature request.Feature request.important 📌This issue is important and will be addressed when capacity allows.This issue is important and will be addressed when capacity allows.
Description
Describe the solution you'd like
As described at original issue and pull request openapi-typescript-codegen does not handle readOnly and writeOnly properties of openapi schemas.
With these properties, it is easier to model properties not for modifiable models.
OpenAPI example:
type: object
properties:
id:
# Returned by GET, not used in POST/PUT/PATCH
type: integer
readOnly: true
username:
type: string
password:
# Used in POST/PUT/PATCH, not returned by GET
type: string
writeOnly: trueExpected example types (not necessary to be generated separately, as @tiholic suggested in his PR):
UserGetResponse: { id: number, username?: string }
UserPostRequest: { id: number, username?, password?: string }
UserPutRequest: { id: number, username?, password?: string }
UserPatchRequest: { id: number, username?, password?: string }vector-omalyutin, JTran-04 and omalyutinmrlubos, dan-cooke and mikhin
Metadata
Metadata
Assignees
Labels
feature 🚀Feature request.Feature request.important 📌This issue is important and will be addressed when capacity allows.This issue is important and will be addressed when capacity allows.