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

Proposal: make pathItem oneOf object, array #487

Closed
claylo opened this issue Oct 18, 2015 · 4 comments
Closed

Proposal: make pathItem oneOf object, array #487

claylo opened this issue Oct 18, 2015 · 4 comments

Comments

@claylo
Copy link

claylo commented Oct 18, 2015

The Swagger 2.0 schema defines pathItem as an object.

If either an object or an array were supported via oneOf or anyOf, all of the assorted requests about how to handle query string params or overloading of endpoint behavior could be dealt with in one shot.

This could be added to 2.0 without breaking backwards compatibility, and seems as though it would require only minor tooling changes. (I say this having gone through swagger-codegen pretty thoroughly.)

@ePaul
Copy link
Contributor

ePaul commented Apr 20, 2016

OpenAPI 2.0 will not be changed, but this could be one possible solution of #146 and related issues for 3.0.

Parent Issue: #574 .

@webron
Copy link
Member

webron commented May 19, 2016

FWIW, as voiced in other tickets, I'm pretty much against the usage of oneOf, anyOf, allOf or any JSON Schema construct usage outside the scope of the Schema Object to express such things. There are simpler ways to do it without making the structure of the spec a pain to write. Granted, it may not be cover all use cases, but it's a trade off.

@fehguy
Copy link
Contributor

fehguy commented Feb 1, 2017

As opposed to what @webron is against, we've merged the above constructs for 3.0. Closing this.

@fehguy fehguy closed this as completed Feb 1, 2017
@gmcelhanon
Copy link

@fehguy Where can I see this change manifested? I've look through the 3.0 spec on the OpenAPI.next branch, but don't see anything obvious related to this. In #487, it is proposed that the pathItem definition be changed to use oneOf, allOf, etc., but I still see the individual operations defined as single Operation Object instances.

What am I missing?

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

No branches or pull requests

5 participants