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

Accept read_write_scope from opts when calling cast functions directly #572

Merged

Conversation

albertored
Copy link
Contributor

@albertored albertored commented Nov 16, 2023

read_write_scope is needed fort correctly handling readOnly and writeOnly required properties but it is non populated when calling directly cast functions. This adds that option.

There was also a problem when the property marked as readOnly or writeOnly is inside a reference. Before this change the check_required_fields function took as input the original ctx with properties not yet resolved. Now the ctx is updated with resolved properties and the required check works as expected. In doing so I also changed a little bit the Object module to make all functions modify and accept the same ctx making the code much more readable.

Fixes #499 and supersedes #513

@albertored albertored changed the title sets read_write_scope from opts, this will permit to comply to readOnly Accept read_write_scope from opts when calling cast functions directly Nov 17, 2023
@albertored albertored force-pushed the read-write-scope-reference branch from ec00ec1 to 881c01c Compare November 22, 2023 16:23
@mbuhot mbuhot merged commit e8a3538 into open-api-spex:master May 24, 2024
12 checks passed
@albertored albertored deleted the read-write-scope-reference branch May 24, 2024 05:04
nathanalderson pushed a commit to Tango-Tango/open_api_spex that referenced this pull request Dec 20, 2024
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.

CastAndValidate plug does not set Cast.read_write_scope
2 participants