M.P.
M.P.

Reputation: 105

How to define 2 query params with same name in RAML

I am trying to define RAML for REST API. According to my specification, I need to set 2 query parameters with the same name. There isn't any possibility to change the specification. Is it possible?

Thanks.

Upvotes: 1

Views: 2120

Answers (1)

ophychius
ophychius

Reputation: 2653

According to the documentation, if you define the parameter as an Array the request can have multiple parameters with the same name. For a more detailed explanation check the RAML specification on the subject.

For example:

types:
  Param:
    type: object
    properties:
      name:
        type: string
  Params:
    type: array
    items: Param
    minItems: 2
    maxItems:2
    uniqueItems: true

Upvotes: 4

Related Questions