Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
701 views
in Technique[技术] by (71.8m points)

swagger - SwaggerUI: Path shows "Default". How can I change?

I downloaded sample server program from http://editor.swagger.io. (Swagger Petstore (Simple), NodeJS)

Then I deployed into my server but the path is showed "Default". How can I change it?

enter image description here

This sample shows the name of paths. This is what I want to do it. http://petstore.swagger.io/#/

enter image description here

package.json

"dependencies": {
  "connect": "^3.2.0",
  "js-yaml": "^3.3.0",
  "swagger-tools": "0.9.*"
}

=============================

Update

This may be related. How to change Swagger-UI "Default" Path

I'm not sure how JSON file is necessary. I'm using yaml. I may be choose .json or .yaml.

And also I'm wondering this is related to my issue..

enter image description here

{
  schemaValidationMessages: [
    {
      level: "error",
      message: "Can't read from file http://xxxxx/api-docs"
    }
  ]
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The grouping is done by the use of tags. Just tag each operation with a string array like such:

get:
  tags:
    - Admin Operations
  parameters: []

The description for tags is defined in a top-level tags object:

tags:
  - name: Admin Functions
    description: These are only for special users!

And this will show the description in the top-level

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...