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

readOnly and writeOnly support v2 #1853

Merged
merged 11 commits into from
Jul 8, 2021
Merged

Conversation

radzserg
Copy link
Contributor

@radzserg radzserg commented Jul 5, 2021

validate requires a new context parameter, that will define validation context - input or output. Based on the context either readOnly or writeOnly parameters will be removed from the required list.

Addresses #1142

Summary

Replace this with something that explains what this PR is for and why it matters.

Checklist

  • The basics
    • I tested these changes manually in my local or dev environment
  • Tests
    • Added or updated
    • N/A
  • Event Tracking
    • I added event tracking and followed the event tracking guidelines
    • N/A
  • Error Reporting
    • I reported errors and followed the error reporting guidelines
    • N/A

Additional context

Read-Only and Write-Only Properties
If a readOnly or writeOnly property is included in the required list, required affects just the relevant scope – responses only or requests only. That is, read-only required properties apply to responses only, and write-only required properties – to requests only.

This PR based on @marcelltoth PR #1619 It's quite old, and it was quite difficult to resolve merge conflicts.

I also made Context a required parameter and removed none option. Since we always have either input or output context.

validate requires new context parameter, that will define validation context - input or output. Based on the context either readOnly or writeOnly parameters will be removed from the required list.
@radzserg radzserg requested review from a team and Amjcraft and removed request for a team July 5, 2021 10:06
@radzserg radzserg changed the title normalize body before validation to strip read/write-only params readOnly and writeOnly support v2 Jul 5, 2021
@marcelltoth
Copy link
Contributor

Wow, I barely even remember that PR, it was among the first things I've done here. 😄 Thanks for bringing it back to life! 🙌 😍

@radzserg radzserg requested review from a team, chohmann and marcelltoth July 6, 2021 11:37
Copy link
Contributor

@chohmann chohmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't get to spend as much time reviewing this today as I thought, but this looks good!

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.

None yet

3 participants