-
Notifications
You must be signed in to change notification settings - Fork 62
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 request body and response representation for ref POST operations #237
Fix request body and response representation for ref POST operations #237
Conversation
I think we can also do the same for the |
I know that patch uses the odata bind style on the parent entity. I'm not sure whether put uses odata bind or is straight on the collection like post. Can you recall? |
(Edited the previous post) This is the current schema in the We can refactor it out into a reusable component as well and reference it as: |
@irvinesunday correct, thanks for catching that, they are essentially the same since the odata type is nullable. To be specific, inserting a new reference in a collection (e.g. a new group member) via POST or updating a single reference (e.g. manager) via PUT takes the same payload. (and both reply 204) |
… into fix/requestBodyAndResponseRepresentationForRefOperations
59114ec
to
2c3c51b
Compare
@millicentachieng I believe @irvinesunday was arguing to refactor things so both PUT and POST in the cases we outlined use the same schema component, or did I misunderstand the point? |
@baywet PUT and POST reference different schemas. |
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.
Thanks for making the changes. Re-reading Irvine's comment I realized he was advocating for a naming convention, not reusing the same schema for PUT and POST. A couple of minor things left.
src/Microsoft.OpenApi.OData.Reader/Operation/RefPostOperationHandler.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.OpenAPI.OData.Reader.Tests/Resources/Multiple.Schema.OpenApi.V2.json
Show resolved
Hide resolved
Co-authored-by: Vincent Biret <vibiret@microsoft.com>
Fixes #228
POST Operation

Referenced Request Body

Referenced Schema
