I'm trying to define the same GET
endpoint but with two different group of parameters (because depending on the parameters you provide, the endpoint filters one way or the other). Something like this:
paths:
/:
get:
parameters:
- in: query
name: parameter1
schema:
type: number
- in: query
name: parameter2
schema:
type: number
/:
get:
parameters:
- in: query
name: parameter3
schema:
type: number
- in: query
name: parameter4
schema:
type: number
As you may have noticed, that returns an error because the key /
is duplicated. So what I want to do it's something like this:
paths:
/:
get:
parameters:
oneOf:
- $ref: paramGroup1
- $ref: paramGroup2
But that gives me an invalid syntax error. I cannot put all query parmeters together because they have to be used separately (due to the nature of the filtering we are implementing). So, any idea about how this can be achieved?