Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I override properties of a parameter definition object when referencing it?

Tags:

swagger

I have some parameter defined in the root parameters

parameters:
   fooParam:
      name: foo
      in: query
      description: Foo foo foo.
      required: false
      type: number
      format: int32

Now I reference it in a path

/pathOne:
   get:
      parameters:
         - $ref: "#/parameters/fooParam"

Let say I want to use that parameter in another path or method, but I want it to be required (required: true)

/pathTwo:
   get:
      parameters:
         - ?????????????????

Is there a way to reference the same parameter and override one or more of its properties?

like image 808
mamuso Avatar asked Jun 19 '15 11:06

mamuso


1 Answers

No, there isn't. This is a limitation of JSON References rather than a limitation of Swagger.

like image 89
Ron Avatar answered Nov 01 '22 03:11

Ron