You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to add Bearer authentication to swagger:operation like below. But, it is not working for swagger:operation but working fine for swagger:route and swagger:meta
Swagger specification
// swagger:operation PUT /user user UpdateUser
//
// Update an existing user
// ---
// consumes:
// - application/json
// produces:
// - application/json
// parameters:
// - name: guid
// in: query
// example: 11111111-1111-1111-1111-111111111111
// description: uuid of the user to update
// required: true
// type: string
// - name: area
// in: body
// description: area parameters
// schema:
// "$ref": "#/definitions/CreateUserStruct"
// required: true
// Security:
// - bearer
//
// SecurityDefinitions:
// bearer:
// type: apiKey
// name: Authorization
// in: header
// responses:
// '201': body:UserCreateSuccessfulResponse
// '400': body:BadRseponse
When i run below command
swagger generate spec -m -o ./swagger.json
It gives me below errors.
operation (UpdateUser): json: cannot unmarshal string into Go struct field OperationProps.security of type map[string][]string
But the same systanx works fine for swagger:meta and swagger:route.
Am I missing something for operation?
Steps to reproduce
Environment
swagger version: dev
go version: go version go1.12.4 windows/amd64
OS: Windows 10
The text was updated successfully, but these errors were encountered:
Problem statement
I am trying to add Bearer authentication to
swagger:operation
like below. But, it is not working forswagger:operation
but working fine forswagger:route
andswagger:meta
Swagger specification
When i run below command
It gives me below errors.
But the same systanx works fine for
swagger:meta
andswagger:route
.Am I missing something for operation?
Steps to reproduce
Environment
swagger version: dev
go version: go version go1.12.4 windows/amd64
OS: Windows 10
The text was updated successfully, but these errors were encountered: