-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Example spec for swagger:response does not produce example output #3035
Comments
Tested from current master. using the above code as main.go and typing, from the same folder: swagger generate spec -c .
{
"swagger": "2.0",
"paths": {},
"responses": {
"validationError": {
"description": "A ValidationError is an error that is used when the required input fails validation.",
"schema": {
"type": "object",
"required": [
"Message"
],
"properties": {
"FieldName": {
"description": "An optional field name to which this validation applies",
"type": "string"
},
"Message": {
"description": "The validation message",
"type": "string",
"example": "Expected type int"
}
}
}
}
}
} This looks pretty much like what was expected, right? |
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Yes this looks correct, glad to know I'm not going crazy. Although it seems I can checkout that commit in the repo, so I cant verify myself on my machine |
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
I am facing the same issue. Opened another issue yesterday, but I've since closed it to align with this. Edit: tested go 1.22 and 1.21.5 on Darwin. Used both static build files of Swagger and homebrew installs. |
Faced the same issue. The referenced models within the the
But everything else the same, correct expected docs are generating for:
|
Problem statement
The docs on this page provide an example of how to produce a swagger response spec from annotations. However running
swagger generate spec -o swagger.yaml
does not produce the example output.Swagger specification
I've copy pasted the example annotation in a test file in package main:
Steps to reproduce
Output:
What it should be:
Notably, the
schemas
and theproperties
fields are missing. Am I calling this incorrectly here?Environment
swagger version:
v0.30.5
go version:
1.21.5 darwin/arm64
OS: macOS 12.6
The text was updated successfully, but these errors were encountered: