Forum Discussion

Peter_XXX's avatar
Occasional Visitor
4 years ago

is it possible to define multiple charset in the content type of a REST call in Swagger?

I'm trying to describe a call like this.    The issue I run into is that the charset that is returned is the charset of the DB.  And we have some DB that for historical reasons are not on th...
  • HKosova's avatar
    4 years ago

    Hi Peter,

    You'll need to define those different encodings as separate media types:

            required: true
              application/json; charset=UTF-8:
                  $ref: '#/components/schemas/Something'
              application/json; charset=iso-8859-1:
                  $ref: '#/components/schemas/Something'


    There's an existing enhancement request to improve the syntax so that parameterized media types can be defined using a single Media Type Object:

    Parameters for Media Types