How to write two parameters in OAS3 spec file?

17 Views Asked by At

I am writing OAS3 spec file for the endpoint of /v1/credit/c123123123

in OAS3 spec file how can I add two parameters?

I tried /creditcardagreements/{keyType}{key}

But it's giving error. Operation must define parameter {keyTypeKey} as expected by path

{
  "openapi" : "3.0.0",
  "info" : {
    "title" : "Credit ",
    "version" : "v1",
    "x-td-appCode" : "CreditCardApplication"
  },
  "paths" : {
    "/creditcardagreements/{keyType}/{key}" : {
      "description" : "Credit Card Details",
      "get" : {
        "description" : "Retrieve Credit Card Details",
        "parameters" : [ {
          "name" : "key",
          "description" : "Unique key which defines card",
          "required" : true,
          "in" : "path",
          "schema" : {
            "description" : "Unique key that identifies a financial credit card agreement.\n",
            "type" : "string"
          }
},
{
          "name" : "keyType",
          "description" : "Type of Credit card",
          "required" : true,
          "in" : "path",
          "schema" : {
            "title" : "Card Identifier",
            "description" : "Type code of credit Account",
            "enum" : [ "c", "a" ],
            "type" : "string"
          }
        }
]
}
0

There are 0 best solutions below