-
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
Add support for slice of byte as example #379
Comments
what's your expected output for base64 encoded? would you provide expected swagger json output ? |
@easonlin404 sorry for the long wait, lots to do :) Anyway, I'd like to get something like this:
Just to adhere to Swagger standards regarding string formats |
Swagger allready do this. Have you tried ?
|
I'm not complaining about Swagger but regarding the inability of |
@prometherion as your definition is []byte , why do you expect to be type="string" |
Closed it by mistake. |
because I'd like to make requests directly from UI |
I'm going to ask you one more time.
Why are u declaring slice of byte when you expect string in documentation ?
I guess you know the difference between []byte and string . |
@ubogdan my bad in the first comment opening the issue :( |
@prometherion There is a way to do this
And will produce
|
I think this should be reopened. Go json marshalling and unmarshalling automatically encodes and decodes a field of type
I think Swaggo should by default use string as a type for these fields. |
@tomquist agreed. Swag labelling |
This is an open source project, anyone is wellcome to improve it. |
Have you find a solution for this issue? |
I'm accepting a payload made of a slice of byte (
[]byte
) but providing the example as string it's not rendered correctly.Definition of the struct:
Rendered swagger definition
Describe the solution you'd like
I'd like to get the example data already base64 encoded
Describe alternatives you've considered
Maybe using string but for this kind of scenarios (like PKI) it's not so elegant.
Additional context
Nothing to add.
The text was updated successfully, but these errors were encountered: