Skip to content

Structural improvements: enhance consumes and produces handling #689

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

Closed
arno-di-loreto opened this issue May 11, 2016 · 2 comments
Closed

Comments

@arno-di-loreto
Copy link
Contributor

Following my ideas from OAI/sig-moonwalk#115 and extending the #660 idea, we could modify consumes and produces handling.

On spec's current version, you handle the produced and consumed media types this way:

Produced and consumed media type can be declared on root level for all paths and operations:

consumes:
  - application/json
produces:
  - application/json

And they can be overridden on operation level:

paths:
  /resources:
    get:
      consumes:
        - application/xml
      produces:
        - application/xml

The idea is to enable definition/overriding at each level (whole API, path, operation) for both produces and consumes and also add produces on response level (as proposed in #660)

paths:
  consumes:
    # apply to all path and operations
  produces:
    # apply to all path and operations
  /resources:
   produces:
     # apply to this path's operations and override upper level
   consumes:
     # apply to this path's operations and override upper level
   get:
     produces:
       # apply to this operation and override upper levels
     consumes:
       # apply to this operation and override upper levels
     responses:
       200:
         produces:
           # apply to this response and override upper levels
@arno-di-loreto
Copy link
Contributor Author

parent #560

@MikeRalphson
Copy link
Member

produces/consumes were removed/reworked in v3.0 and I think the content approach covers the issue here.

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

3 participants