-
Notifications
You must be signed in to change notification settings - Fork 72
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
[question] Is there a way to return user defined schema type as "file" #99
Comments
I see in this commit 480c8f3 made change to be able to handle time.Duration type. But, however, file is not a type. is there a better way to handle this case similar issue in go-swaggo go-swagger/go-swagger#1003 |
thank for reporting this issue.
that is check in the Returns to allow a
will produce your result. |
@aryanicosa would that work for you? |
I got your point and able to imagine the result, but I am sorry because confuse how to implement it I realize that schema type is added here https://github.com/emicklei/go-restful-openapi/blob/v2/build_path.go#L287 I am still learn and try to figure it out |
you are on the right track, i think. From the top of my head, we could have a check after line 261.
|
currently Returns it take code, message interface as parameters.
e.g: Returns(http.StatusOK, http.StatusText(http.StatusOK), "file")
it will produce apispec like this:
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string",
}
}
However, I am trying to fine a way to create api spec like below, because in reality the handler is returning a file to user
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "file",
}
}
The text was updated successfully, but these errors were encountered: