bob dabelina
bob dabelina

Reputation: 537

How to declare embedded body parameters in swagger yaml format

I have a sample request input with the nested post parameters in JSON which looks like below. I have to know use this data to create definition in YAML format but I have no idea how to do this.

I have read the swagger docs but still can't crack this.

"clientAttributes" : [ {
"id" : "1",
"clientDetail" : [ {
  "clientNum" : "98062217",
  "clientCntryCd" : "55",
  "clientTypeList" : [ {
    "clientTypeCd" : "HomePhone",
    "cntryCd" : ""
  } ]
} ]} ],

Upvotes: 0

Views: 221

Answers (1)

William Cheng
William Cheng

Reputation: 10807

A good example is the Pet object defined in petstore.yaml, which contains 2 objects as the properties: category, tags

For your case, you will need to define clientAttributes, clientDetail, clientTypeList as objects.

Upvotes: 1

Related Questions