swagger-node icon indicating copy to clipboard operation
swagger-node copied to clipboard

POST http://localhost:10010/user 400 (Bad Request)

Open xiaonizi-github opened this issue 7 years ago • 0 comments

hello,i have occured a problem,but i dont why?that is my following settings: swagger: "2.0" info: version: "0.0.1" title: Hello World App

during dev, should point to your local machine

host: localhost:10010

basePath prefixes all resource paths

basePath: / tags:

  • name: "pet" description: "Everything about your Pets" externalDocs: description: "Find out more" url: "http://swagger.io"
  • name: "store" description: "Access to Petstore orders"
  • name: "user" description: "Operations about user" externalDocs: description: "Find out more about our store" url: "http://swagger.io" schemes:
  • "http" paths: /user: x-swagger-router-controller: hello_world post: tags: - "user" summary: "Create user" description: "This can only be done by the logged in user." operationId: "createUser" produces: - "application/xml" - "application/json" parameters: - in: "body" name: "body" description: "Created user object" required: true schema: $ref: "#/definitions/Order" responses: default: description: "successful operation" definitions: Order: type: "object" properties: id: type: "integer" format: "int64" petId: type: "integer" format: "int64" quantity: type: "integer" format: "int32" shipDate: type: "string" format: "date-time" status: type: "string" description: "Order Status" enum: - "placed" - "approved" - "delivered" complete: type: "boolean" default: false xml: name: "Order"

i used mock mode,when i send request ,**that response Headers undefined Body,**the setting is writted by swagger-editor,when i set the method is get ,all method can run success,when i set the method is post,most of the method run failure,what should do ?

xiaonizi-github avatar Jul 21 '17 02:07 xiaonizi-github