Ilya Chernomordik
Ilya Chernomordik

Reputation: 30375

Is is possible to specify default request/response format at a root level in OpenAPI 3.0?

In Swagger 2.0 there was a possibility to describe a default response and request content type on a root level:

produces:
  - application/json

The only way in OpenAPI 3.0 I have found is to describe it per request/response:

    responses:
     '200':
       content:
        application/json:

This is a bit cumbersome and repetitive if almost all of your request deal with only JSON data. So it was quite a nice feature to define a "default" behavior.

So I am really wondering if it is possible to have a default one with a possibility to override it if necessary.

Upvotes: 2

Views: 410

Answers (1)

Helen
Helen

Reputation: 98052

No, OpenAPI 3.0 does not have global media types. If you need this feature, consider opening an issue in the OpenAPI Specification repository.

Upvotes: 2

Related Questions