Skip to content

Allow shorthand $ref for parameters and responses  #171

@mohsen1

Description

@mohsen1

This is 2.1 proposal

In 2.0 we have a shorthand definition for schemas. If user do not provide #/definitions/ prefix, we will prepend it to their value in $ref if it's a schema value.

This should work for parameters and responses too

Example:

swagger: '2.1'
info:
  version: "1.0.0"
  title: shorthand ref example
paths:
  /:
    get:
      parameters:
        - $ref: size
      responses:
        $ref: 200


responses:
  200:
    description: Success

parameters: 
  size:
    name: size
    in: query
    required: true
    type: string

Resolver should understand the context of $ref and look in proper object.

Related to #132

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions