To restrict the occurrences of query parameters in API Spec

Hi, 

I want to restrict the number of query parameters to be used in the request by limiting the maximum occurrence of query parameter (say at most 5) in my yaml (API Spec) .

I tried using the below attributes to do the same.

mimimum: 1 

maximum : 5 

Can you pls suggest?

@anilsagar @dchiesa1 

0 2 257
2 REPLIES 2

Go thru below & see if it helps.

https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterObject

- name: limit
  in: query
  description: number of pets to return
  type: integer
  minimum: 1
maximum: 5

 

the example that you have shared is for restricting the value of the query param named - "limit" . 

What I intend to restrict is the number of query parameters from my yaml .  Like I only want to allow (say for example ) 3 query parameters to come as part of the request.