Swagger won't generate right json to post from yaml Swagger won't generate right json to post from yaml curl curl

Swagger won't generate right json to post from yaml


The parameter syntax is wrong. If the operation is supposed to consume application/x-www-form-urlencoded, you need to use in: form parameters instead of in: body:

 *     consumes: *       - application/x-www-form-urlencoded *     ... *     parameters: *     -  name: email *        in: form              <----------- *        description: Email *        required: true *        type: string *     -  name: password *        in: form              <----------- *        description: password *        required: true *        type: string *     -  name: fullName *        in: form              <----------- *        description: full name *        required: true *        type: string

If it is supposed to consume JSON, you need a single in: body parameter, and individual fields (email, password, etc.) should be the properties of the body object:

 *     consumes: *       - application/json *     ... *     parameters: *     -  name: body *        in: body *        required: true *        schema: *          type: object *          required: [email, password, fullName] *          properties: *            email: *              type: string *              format: email *              description: Email *            password: *              type: string *              format: password *              description: password *            fullName: *              type: string *              description: full name