ng-openapi-gen
ng-openapi-gen copied to clipboard
Add suport for readOnly properties. Add experimental flag.
This PR is the follow up to #193 .
Openapi allows the use of the readOnly
modifier to specify model properties that shouldn't be used to create a new object (via post or put). This PR makes OA3's readOnly
properties to have the readonly
modifier and POST
and PUT
requests that use such schemas to wrap the body's request type in a Writable
type wrapper.
This follows the behavior of other OA3 generators (like OpenAPITools/openapi-generator).
Since this feature can be considered as having a low number of use cases I've made it available via an --experimental
flag.
Also added test cases for both the wrapper and the flag.
Thanks for the PR. I'll take a look on it when I have some time.
@schimini , @luisfpg is there any update on this? Would be pretty cool if readonly
was handled
Sorry, I've only now found some time to review the PR's... It's currently conflicting. Also, as it is a large change set, I'd need to review in more details. Can you, please, update the PR with conflict merging? Thanks!
Hi @luisfpg, First of all sorry for leaving this year without resolution. I don´t remember receiving the notification for it so this is a bit unfortunate. Despite that I found it now and resolved the conflicts.
Thanks for everything! Happy new year!
Also just saw your comment @marcellkiss and I'm sorry for taking so long