Forum Discussion

aaronpliu's avatar
aaronpliu
Frequent Contributor
7 years ago

How to resolve the same parameter in both path and header

The swagger(.json) defined a parameter with the same name in header and path, as a result, Only one (parameter in metaHeader) is available, and then missing in path. We knew that ReadyAPI is not allowed to the same parameter in properties. Do you know an alternative solution for that?

 

For example:

"parameters": [

    {

        "name": "IDCard",

        "in": "path",

        "required": true,

        "format": "int64"

    },

    {

        "name": "IDCard",

        "in": "header",

        "required": false,

        "description": "MetaHeader.IDCard",

        "format": "string"

    }

]

 

    • aaronpliu's avatar
      aaronpliu
      Frequent Contributor

      , I know would add the same property in "Headers" tab. However, all of properties are shown in "Request" tab with different "Style", ie: Template (for path), Header (for header), Query (for parameter). I mean when you import swagger, the same property will only show one in this tab since there are 2 the same properties in source definition. I can manually add header parameter in "Headers" tab, but it's not proper to update every time, especially path parameter filled with variable.

      is there any way to display all Header parameters in "Headers" tab, not in "Request" table?

       

      Thanks in advance

      /Aaron