Skip to content
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

'Select File' button isn't presented for 'image/*' media types in binary format #4685

Closed
VjacheslavVytjagov opened this issue Jul 2, 2018 · 0 comments

Comments

@VjacheslavVytjagov
Copy link

Q&A (please complete the following information)

  • OS: [Windows 10]
  • Browser: [chrome]
  • Version: [67]
  • Method of installation: [dist assets]
  • Swagger-UI version: [3.17.1]
  • Swagger/OpenAPI version: [OpenAPI 3.0]

Content & configuration

Example Swagger/OpenAPI definition:

openapi: 3.0.0
info:
  version: '2018-05-07T12:39:34Z'
  title: OCR API
servers:
  - url: http://api.example.com/v1
    description: Optional description
paths:
  /imagesValid:
    post:
      requestBody:
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: Optional description
          content:
            text/plain:
              schema:
                type: string
  /imagesInvalid:
    post:
      requestBody:
        content:
          image/png:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: Optional description
          content:
            text/plain:
              schema:
                type: string

Swagger-UI configuration options:

SwaggerUIBundle({
        url: "./swagger.json",
        dom_id: '#swagger-ui',
        deepLinking: true
})

Describe the bug you're encountering

There is no button 'Select file' in 'Try it out' mode for 'image/*' media types.

To reproduce...

Steps to reproduce the behavior:

  1. Go to '/imagesValid' resource
  2. Click on 'Try it out'
  3. Make sure that 'Select file' button is presented
  4. Go to '/imagesInvalid' resource
  5. Click on 'Try it out'
  6. Make sure that 'Select file' button isn't presented

Expected behavior

I expect that 'Try it out' panel will contain button to select file for media types 'image/*' , not only for 'application/octet-stream'.

@lock lock bot locked and limited conversation to collaborators Jul 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant