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

Operations with long paths render strangely #5171

Closed
linelson opened this issue Feb 11, 2019 · 4 comments
Closed

Operations with long paths render strangely #5171

linelson opened this issue Feb 11, 2019 · 4 comments

Comments

@linelson
Copy link
Contributor

linelson commented Feb 11, 2019

Q&A (please complete the following information)

  • OS: Windows 10
  • Browser: Chrome 71.0.3578.98
  • Method of installation: npm
  • Swagger-UI version: 3.20.7
  • Swagger/OpenAPI version: Either

Content & configuration

Example Swagger/OpenAPI definition:
Excerpt from edited petstore json found here: http://petstore.swagger.io/v2/swagger.json

paths:
 /pet/with/a/really/long/made/up/path/that/keeps/going/and/going/and/when/will/it/ever/stop/nobody/knows/:
    post:
      tags:
        - pet
      summary: M:Microsoft.SomeNamespace.Some.Really.Long.Namespace.SomeController.MethodName(System.String,System.String,System.String,System.String,Newtonsoft.Json.Linq.JToken) 
      description: ''

Swagger-UI configuration options:

Easily reproducible in the swagger ui rendered by the editor at editor.swagger.io

Describe the bug you're encountering

Operations with very long paths and summaries render strangely. The long path takes maybe 90% of the space, resulting
in the operation summary rendering very strangely.

To reproduce...

Steps to reproduce the behavior:

  1. View a document with an operation that (a) has a very long path and (b) has a non-empty summary or a summary with a single very long word (like a namespace)
  2. Note the 'squished' appearance of the operation summary or the path. See screenshot. It looks worse the longer the operation summary is.

Expected behavior

Better wrapping and space distribution. Wrapping would ideally occur at a '/' in the path and more horizontal space should be given to the summary.

Screenshots

image

More dramatic example:
image

Bad wrapping with the summary:
image

@shockey
Copy link
Contributor

shockey commented Feb 12, 2019

Oof!

@shockey
Copy link
Contributor

shockey commented Feb 16, 2019

#5184 vastly improves the situation here:

image

thanks for reporting, @linelson!

@tnpradeep
Copy link

Hello,

Can we have summary in next line when the path name is too long ?

@shockey
Copy link
Contributor

shockey commented Apr 5, 2019

@tnpradeep thanks for the suggestion! it's not possible at the moment, but we may add it in the future.

@lock lock bot locked and limited conversation to collaborators Apr 4, 2020
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

3 participants