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

Generated client -> html -> index.html - doesn't format code blocks to wrap long http responses #4656

Open
ipepe opened this issue Dec 11, 2023 · 0 comments

Comments

@ipepe
Copy link

ipepe commented Dec 11, 2023

Q&A (please complete the following information)

  • OS: macOS
  • Browser: chrome
  • Version: 120.0.6099.71
  • Method of installation: visiting webpage https://editor-next.swagger.io/
  • Swagger-Editor version: 5.0.0-alpha.83
  • Swagger/OpenAPI version: OpenAPI openapi: 3.0.3

Content & configuration

Example Swagger/OpenAPI definition:

        '400':
          description: With invalid params responds bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: object
                    properties:
                      base:
                        type: array
                        items:
                          type: string
                    required:
                    - base
                required:
                - errors
              example:
                errors:
                  base:
                  - did not contain a required property of 'base'
                  - did not contain a required property of 'base'
                  - did not contain a required property of 'base'
                  - did not contain a required property of 'base'
                  - did not contain a required property of 'base'
                  - did not contain a required property of 'base'
                  - did not contain a required property of 'base'
                  - did not contain a required property of 'base'
                  - did not contain a required property of 'base'
                  - did not contain a required property of 'base'
                  - did not contain a required property of 'base'

Swagger-Editor configuration options:

SwaggerEditor({
  // your config options here
})
?yourQueryStringConfig

Describe the bug you're encountering

When exporting a swagger documentation that has long example response, then generate client -> html returns html that contains <code tag that doesn't word wrap. It needs it have style of white-space: pre-wrap;

To reproduce...

Steps to reproduce the behavior:

  1. Import swagger documentation that contains really long response
  2. Generate client -> HTML
  3. Open generated index.html
  4. Example response is overflowing the page in <code> tag

Expected behavior

I expected that generated index.html doesn't require to scroll horizontally to see full response.

Screenshots

Screenshot 2023-12-11 at 12 34 37

Additional context or thoughts

I could probably implement necessary change, but I have no idea where html generate client code lives

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