-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
Problem statement
I set a request parameter as formData
and get the following error.
invalid character '-' in numeric literal\n\nrequest body: \"--------------------------2d70d43748b1608c\r\nContent-Disposition: form-data; name=\"user_id\"\r\n\r\n123\r\n--------------------------2d70d43748b1608c--\r\n\"\n
Swagger specification
swagger: "2.0"
consumes:
- application/json
produces:
- application/json
schemes:
- http
paths:
/v1/users:
post:
operationId: postUser
consumes:
- multipart/form-data
parameters:
- name: image
type: file
in: formData
- name: user_id
type: integer
format: int64
in: formData
required: true
Steps to reproduce
Execute the following commands.
# Set up the server
$ go run ./cmd/myapp-server/main.go --host 0.0.0.0 --port 8080
# Request
$ curl -X POST \
-H "Content-Type: multipart/form-data" \
-F user_id=123 \
http://localhost:8080/v1/users
Environment
swagger version: 0.25.0
go version: 1.15.6
OS: macOS Catalina 10.15.7