Skip to content

Instantly share code, notes, and snippets.

@manuc66
Created May 30, 2017 14:19
Show Gist options
  • Save manuc66/6949ccf855a54e65db40f32eb4b37af2 to your computer and use it in GitHub Desktop.
Save manuc66/6949ccf855a54e65db40f32eb4b37af2 to your computer and use it in GitHub Desktop.
swagger: "2.0"
info:
version: "1.0.0"
title: "Swagger Petstore"
basePath: "/v2"
consumes:
- "application/json"
produces:
- "application/xml"
paths:
/pet:
get:
responses:
400:
description: "Invalid input"
schema:
$ref: "#/definitions/error"
definitions:
invalid-foo-error:
allOf:
- $ref: '#/definitions/error'
- type: object
required:
- key
- foo
properties:
key:
type: string
default: invalid-time-bounds-error
readOnly: true
message:
type: string
foo:
type: string
error:
type: object
discriminator: key
required:
- key
properties:
key:
type: string
default: generic-error
message:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment