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

V2: Miss Host, BasePath #1932

Open
evidwong opened this issue Nov 26, 2024 · 0 comments
Open

V2: Miss Host, BasePath #1932

evidwong opened this issue Nov 26, 2024 · 0 comments

Comments

@evidwong
Copy link

docs.go
`// Code generated by swaggo/swag. DO NOT EDIT.

package docs

import "github.com/swaggo/swag/v2"

const docTemplate = { "schemes": {{ marshal .Schemes }}, "components": {"schemas":{"web.APIError":{"properties":{"errorCode":{"type":"integer"},"errorMessage":{"type":"string"}},"type":"object"}}}, "info": {"contact":{"email":"[email protected]","name":"API Support","url":"http://www.swagger.io/support"},"description":"{{escape .Description}}","license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"},"termsOfService":"http://swagger.io/terms/","title":"{{.Title}}","version":"{{.Version}}"}, "externalDocs": {"description":"","url":""}, "paths": {"/testapi/get-string-by-int/{some_id}":{"get":{"description":"get string by ID","parameters":[{"description":"Some ID","in":"path","name":"some_id","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"ok"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/web.APIError"}}},"description":"We need ID!!"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/web.APIError"}}},"description":"Can not find ID"}},"summary":"Add a new pet to the store"}},"/testapi/get-struct-array-by-string/{some_id}":{"get":{"description":"get struct array by ID","parameters":[{"description":"Some ID","in":"path","name":"some_id","required":true,"schema":{"type":"string"}},{"description":"Offset","in":"query","name":"offset","required":true,"schema":{"type":"integer"}},{"description":"Limit","in":"query","name":"limit","required":true,"schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"ok"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/web.APIError"}}},"description":"We need ID!!"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/web.APIError"}}},"description":"Can not find ID"}}}}}, "openapi": "3.1.0", "servers": [ {"url":"petstore.swagger.io:8080/v2"} ] }

// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Title: "Swagger Example API",
Description: "This is a sample server Petstore server.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}

func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}
`

miss Host, BasePath, when run command swag init --v3.1 swagger.json miss too

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