-
Notifications
You must be signed in to change notification settings - Fork 57
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
fix: respect readOnly and writeOnly properties for required checks #130
Conversation
Codecov Report
@@ Coverage Diff @@
## main #130 +/- ##
==========================================
+ Coverage 89.49% 89.51% +0.02%
==========================================
Files 70 70
Lines 3949 4043 +94
==========================================
+ Hits 3534 3619 +85
- Misses 298 303 +5
- Partials 117 121 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
@@ -24,7 +24,7 @@ components: | |||
required: | |||
- id | |||
- name | |||
- nickname |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's no nickname property, if this was intentional need to address this at the test level
@@ -16,13 +16,15 @@ const ( | |||
) | |||
|
|||
func l(t *testing.T, v int) *openapi3.T { | |||
t.Helper() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:-)
Hi Gustavo, In addition to the scenario you addressed (adding/deleting properties from/to the RequiredProperties list), I implemented solutions for a couple more use-cases:
It would be great if you could take a look and verify these use-cases too. Thanks, |
@reuvenharrison thanks for looking into this, I see you pushed some changes to address the comments and I just merged main to resolve some conflicts, is there anything else you think I should look into before getting it merge? |
Closes #126
Edit: the original approach was to filter only if not breaking changes but I though about it a bit better and I think it makes more sense to always filter readonly for a request type and write only for a response type since this is more aligned with the spec