Can I mix parameter types in a Swagger document
- 8 years ago
Hi there, glad to see you've solved the issue.
There are two places parameters can be declared inside an API spec.
The first is at the top level, being referred to as the Parameters Definitions Object - http://swagger.io/specification/#parameters-definitions-object-103. There, you can define parameters that can be reused in your spec. For that reason, the structure is a map of names that you give to those parameters, and their actual structure.
The second place is under the operations themselves. In that case, `parameters` is an array of parameters, that can either be defined directly there or referenced to the parameters defined above for reuse.
The structure of `parameters` differs (object vs array), which is why you saw a different example than what you actually needed.