3

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?

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.