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

Allow for responses and parameters shared across all endpoints #1577

Closed
dsample opened this issue May 8, 2018 · 8 comments
Closed

Allow for responses and parameters shared across all endpoints #1577

dsample opened this issue May 8, 2018 · 8 comments
Labels

Comments

@dsample
Copy link

dsample commented May 8, 2018

Similar to Parameters and Servers being part of the Path Item Object schema, Parameters being part of the root schema, and Responses being part of the Path Item Object and root schemas would be useful.

Responses

This would be useful for services using CDN/throttling services (eg. CloudFlare) which have responses at a higher level than each endpoint (eg. 429). It would also be useful when a service has standard error response schemas for 400, 502, and 504 statuses.

It might also be useful for others to be able to define responses at Path Item level too. This is similar to Parameters and Servers

Parameters

This would be useful for common required headers (eg. OpenTracing). We have a couple of IDs we require on all requests, so it would be nice to not have to repeat ourselves throughout our API specs.

@darrelmiller
Copy link
Member

One of the items on our possibility list #1466 for 3.1 is being able to re-use groups of parameters. That should help with common required headers. It's still not quite as clean as being able to do it once at the root. However, my concern with doing it at the root, is immediately we will get the request to do exceptions and that just gets complicated and ugly.

The global responses is an interesting one. I'll add a review label and we will bring it up at the @OAI/tsc meeting on Monday.

@dsample
Copy link
Author

dsample commented Jun 4, 2018

@darrelmiller, any update on this? I see from the minutes (#1581) that you ran out of time.

Responding to one of your points you made:

my concern with doing it at the root, is immediately we will get the request to do exceptions and that just gets complicated and ugly.

If the definition were explicitly around the requirement of common headers across all endpoints, I don't think it would be unreasonable to reject requests to allow exceptions. I can't think of anything else in the spec which would have exceptions, so it's not an established pattern (I don't think even JSON Schema allows exceptions).

@darrelmiller
Copy link
Member

@dsample I will bring it up in the meeting today at 12EST.

@MikeRalphson
Copy link
Member

Related: OAI/Overlay-Specification#34

@darrelmiller
Copy link
Member

@dsample We didn't have much time left to discuss this, but there is a feeling that our work on grouping parameters and possibly the implementation of RAML like traits may help to address this need. We will continue the conversation next week.

@handrews
Copy link
Member

handrews commented Jun 4, 2018

I don't think even JSON Schema allows exceptions

What sort of exceptions?

@dsample
Copy link
Author

dsample commented Jun 10, 2018

@handrews, the exception requirement @darrelmiller mentions concerns about in his original reply. My point being that I think it's not a valid concern.

@darrelmiller
Copy link
Member

See OAI/Overlay-Specification#34 #1466 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants