API has more than one body parameter?
my yml file:
parameters:
# {"role":"twemproxy","type":"lvs","master_id":1,"standby_id":2}
- name: role
in: body
description: pool role,twemproxy or mysql.
required: true
schema:
$ref: '#/definitions/Pool'
- name: type
in: body
description: pool role,twemproxy or mysql.
required: true
schema:
$ref: '#/definitions/Pool'
why swagger-editer only support one body parameter? My rest api 's request data is : {"role":"twemproxy","type":"lvs","master_id":1,"standby_id":2} how should i write my yml file?
That's not two body parameters, that's a single one. One object containing the role, type, master_id and standby_id properties.
@webron so....how should i write my yml file?

the body object is :

but how should i name the parameters ( in the picture,it's 'a' ) ? .... i don't think it looks well to understand....
my parameters config:

It looks like you may have hit a bug in swagger-editor, so please open an issue there. You've named your parameter data and that's what it should display.
it's my fault to show the parameter'name to 'a'. e.... if the parameter is in body,the parameter's name is not used in the request,is it? so,i think the name should show "role","master_id","standby_id","type". if the name is data,it makes me confused.
The name of the body parameter is not used in creating the request, it's just used for documentation purposes.
ok,thank you.
So how it should be defined?
I also want to define every property of the request.body in /post and /put. How can I do it?
How should what be defined?
I meant the possibility to define body object with a lot of properties. But solved it in this way:
parameters:
- name: body
in: body
schema:
$ref: "#/definitions/PostData"