Closed
Description
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:
type MyBinding struct {
Crt []byte `json:"crt" example:"-----BEGIN CERTIFICATE-----(...)-----END CERTIFICATE-----"`
Key []byte `json:"key" example:"-----BEGIN RSA PRIVATE KEY-----(...)-----END RSA PRIVATE KEY-----"`
}
Rendered swagger definition
"models.MyBinding": {
"type": "object",
"properties": {
"crt": {
"type": "array",
"items": {
"type": "integer"
}
},
"key": {
"type": "array",
"items": {
"type": "integer"
}
}
}
},
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.