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

if a path's summary contains a period, it's used for the link and title #124

Closed
ghost opened this issue Mar 13, 2018 · 6 comments
Closed

Comments

@ghost
Copy link

ghost commented Mar 13, 2018

spectacle version 0.9.13, swagger spec version 2.0 (generated by goswagger 0.13.0)

I noticed something strange when I ran spectacle against my swagger json. In the left sidebar some of my endpoints were listed by their method and endpoint, and some were listed by their summary. I did an audit and realized the pattern: those with a period "." in their summary were the ones listed by their summary.

sidebar

Further, the main content would display the summary as the title, and have a "Path" block under it.

unexpected content

The behavior I expect is for the title to be the method and path, and there to be a Description block under it.

expected content

@yyamano
Copy link
Contributor

yyamano commented Apr 5, 2018

@spencer-rig I can't reproduce it. Could you upload the swagger file?

@ghost
Copy link
Author

ghost commented Apr 5, 2018

Maybe it's more complex than just the period at the end of the summary. Here's a swagger json that shows the behavior for me (spectacle v 0.9.13)
swagger.txt

@ghost
Copy link
Author

ghost commented Apr 5, 2018

Scrubbing out the parameters and responses also ends with the same behavior:
swagger2.txt

@yyamano
Copy link
Contributor

yyamano commented Apr 6, 2018

@spencer-rig Thank you, I got it.

The difference comes from "summary" field. Could you try to change "summary" to "description"?

  "paths": {
    "/admin/demodata": {
      "get": {
        "summary": "Sets up demo data and responds 200 OK.",
    "/admin/organizations": {
      "get": {
        "description": "Returns a list of Organizations",

@auscaster
Copy link
Member

auscaster commented Apr 7, 2018 via email

@ghost
Copy link
Author

ghost commented Apr 9, 2018

Gotcha, ok. I think my issue stems from using a different tool: that if my code comment includes a period it'll be parsed by goswagger as a summary instead of a description. Thanks for the clues and insight!

@ghost ghost closed this as completed Apr 9, 2018
This issue was closed.
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

2 participants