I'm using go-swagger for generating swagger file for our apis
I've been trying to add comments for an api that is used to upload a single file but the annotations for file and form data simply is not working
here is the comments for the said api
// swagger:route POST /admin/upload Files uploadFile
//
// Upload a file.
//
//
// Consumes:
// - multipart/form-data
//
// Produces:
// - application/json
//
// Schemes: https
//
// Deprecated: false
//
//
// Parameters:
// + name: Authorization
// in: header
// required: true
// type: string
//
// + name: file
// in: formData
// required: true
// type: file
//
// Responses:
// 200: StatusOK
// 403: Error
the generated swagger file for this:
/admin/upload:
post:
consumes:
- multipart/form-data
operationId: uploadFile
parameters:
- in: header
name: Authorization
required: true
type: string
- name: file
required: true
type: object
produces:
- application/json
responses:
"200":
description: StatusOK
schema:
$ref: '#/definitions/StatusOK'
"403":
description: Error
schema:
$ref: '#/definitions/Error'
schemes:
- https
summary: Upload a file.
tags:
- Files
as you can see it changes the file parameter type to object
anyone has any idea how I can fix this?