apiaryio / fury-adapter-swagger

Swagger 2.0 parser adapter for Fury.js
MIT License
11 stars 12 forks source link

Support media types with parameters #145

Closed honzajavorek closed 6 years ago

honzajavorek commented 6 years ago

According to my tests, following document isn't processed correctly:

swagger: "2.0"
info:
  title: Produces Header With Content-Type Parameters
  version: "1.0"
paths:
  /test:
    get:
      produces:
        - application/json; charset=utf-8
        - application/xml
      responses:
        200:
          description: Test description
  /test-with-override:
    get:
      produces:
        - application/json; charset=utf-8
      responses:
        200:
          description: Test description when overriding produce content type
          headers:
            content-type:
              type: string
              default: text/plain

The application/json; charset=utf-8 media type doesn't seem to be recognized as a JSON media type. This blocks resolving https://github.com/apiaryio/dredd/issues/883 and https://github.com/apiaryio/dredd/issues/553.

honzajavorek commented 6 years ago

I'm not entirely sure this issue is valid and the adapter skips the media types with charset or not. I need to dig more into this.

honzajavorek commented 6 years ago

Looking at https://github.com/apiaryio/fury-adapter-swagger/blob/f5840689e201f96ea9df0e052a9e417482f7ceb6/src/media-type.js#L17 I think this issue is invalid.