Skip to content
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

Add suport for readOnly properties. Add experimental flag. #203

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

schimini
Copy link

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.

@luisfpg
Copy link
Contributor

luisfpg commented Jan 23, 2022

Thanks for the PR. I'll take a look on it when I have some time.

@marcellkiss
Copy link
Contributor

@schimini , @luisfpg is there any update on this? Would be pretty cool if readonly was handled

@luisfpg
Copy link
Contributor

luisfpg commented Aug 25, 2022

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!

@schimini
Copy link
Author

schimini commented Jan 4, 2023

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!

@schimini
Copy link
Author

schimini commented Jan 5, 2023

Also just saw your comment @marcellkiss and I'm sorry for taking so long

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants