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

Charset of text/plain response is ignored #10186

Open
xehpuk opened this issue Nov 1, 2024 · 0 comments
Open

Charset of text/plain response is ignored #10186

xehpuk opened this issue Nov 1, 2024 · 0 comments

Comments

@xehpuk
Copy link

xehpuk commented Nov 1, 2024

Q&A (please complete the following information)

  • Swagger-UI version: 5.17.14
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

Example Swagger/OpenAPI definition:

openapi: 3.0.1
info:
  title: Test
  version: 1.0.0
servers:
- url: http://localhost:8080
paths:
  /test:
    get:
      responses:
        "200":
          description: OK

Swagger-UI configuration options:

SwaggerUIBundle({
  url: "https://petstore.swagger.io/v2/swagger.json",
  dom_id: '#swagger-ui',
  deepLinking: true,
  presets: [
    SwaggerUIBundle.presets.apis,
    SwaggerUIStandalonePreset
  ],
  plugins: [
    SwaggerUIBundle.plugins.DownloadUrl
  ],
  layout: "StandaloneLayout",
  configUrl: "/v3/api-docs/swagger-config",
  operationsSorter: "alpha",
  tagsSorter: "alpha",
  validatorUrl: ""
})

Describe the bug you're encountering

To reproduce...

Steps to reproduce the behavior:

  1. Create a webserver listening on /test and returning text/plain;charset=X with a charset other than UTF-8.
  2. Send a request via Swagger UI.
  3. In the response body view, the response appears to be decoded with UTF-8.

Expected behavior

I expected the response to be decoded with the charset provided in the Content-Type header.

Additional context or thoughts

Works in other clients like Chrome DevTools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant