-
-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
I'm having trouble using binary parameters, I'm not sure what I'm doing wrong.
I have a parameter defined with:
"note-prefix": {
"type": "string",
"format": "byte",
"description": "Specifies a prefix which must be contained in the note field.",
"name": "note-prefix",
"in": "query"
},
This generates a parameter object as expected with:
NotePrefix *[]byte `json:"note-prefix,omitempty"`
Now I try to use the parameter by getting a base64 string echo "test" |base64, and url encoding it to get dGVzdAo%3D.
But the parameter isn't properly parsed:
$ curl -s "localhost:8980/transactions?note-prefix=dGVzdAo%3D" | json_pp
{
"message" : "Invalid format for parameter note-prefix: error setting array element: error binding string parameter: can not bind to destination of type: uint8"
}
I'm hoping that this is user error, but it looks like an entry is missing from this:
https://github.com/deepmap/oapi-codegen/blob/88bfbcf8cc7a4c8bfa82c3f0a6cfd0eb1db34d63/pkg/runtime/bindstring.go#L50
Hoping that someone can confirm.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels