Skip to content

Swagger-ui for JSON APIs sends incorrect content-type  #721

Closed
@dblock

Description

@dblock

Coming from swagger-api/swagger-ui#4981

Swagger UI produces multipart bodies on POST tries. I believe this is because the swagger API produces fields with in: 'formData'. It seems that the code does that for any primitive type, instead of doing in: 'body'. Doesn't seem right.

Monkey patching this works around the problem.

module GrapeSwagger
  module DocMethods
    class DataType
      class << self
        def request_primitive?(type)
          false
        end
      end
    end
  end
end

But probably not the right solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions