Skip to content

Instantly share code, notes, and snippets.

@eropple
Created February 12, 2018 18:39
Show Gist options
  • Save eropple/1cb8241b11c48ed4e89363dbaf4998fa to your computer and use it in GitHub Desktop.
Save eropple/1cb8241b11c48ed4e89363dbaf4998fa to your computer and use it in GitHub Desktop.
---
openapi: 3.0.1
info:
title: Full Descriptor
version: 1.0.0
paths:
"/path-simple/{a}/{b}/{c}":
get:
operationId: getPath
summary: A path parameter test
deprecated: false
tags: []
security: []
parameters:
- name: a
in: path
required: true
deprecated: false
schema:
type: integer
- name: b
in: path
required: true
deprecated: false
schema:
type: string
- name: c
in: path
required: true
deprecated: false
schema:
type: integer
responses:
default:
description: No description provided.
headers: {}
content:
application/json: {}
"/http-security/bearer":
get:
operationId: getHttpBearer
summary: a route that tests for Bearer scheme in the Authorization header
deprecated: false
tags: []
security:
- httpBearerFoo: []
parameters: []
responses:
default:
description: No description provided.
headers: {}
content:
application/json: {}
"/http-security/multi":
get:
operationId: getHttpMulti
summary: a route that tests for a Bearer or NotBearer scheme in the Authorization
header
deprecated: false
tags: []
security:
- httpMultiBearerFoo: []
- httpMultiNotBearerBar: []
parameters: []
responses:
default:
description: No description provided.
headers: {}
content:
application/json: {}
"/apikey-security/header":
get:
operationId: getApiKeyHeader
summary: a route that tests for a X-Modern-Token header
deprecated: false
tags: []
security:
- headerFoo: []
parameters: []
responses:
default:
description: No description provided.
headers: {}
content:
application/json: {}
"/required-body-hash":
post:
operationId: postRequiredBodyHash
summary: when the request body is required for a hash
deprecated: false
tags: []
security: []
parameters: []
responses:
default:
description: No description provided.
headers: {}
content:
application/json: {}
"/required-body-struct":
post:
operationId: postRequiredBodyStruct
summary: when the request body is required for a struct
deprecated: false
tags: []
security: []
parameters: []
responses:
default:
description: No description provided.
headers: {}
content:
application/json: {}
"/required-body-nested-struct":
post:
operationId: postRequiredBodyNestedStruct
deprecated: false
tags: []
security: []
parameters: []
responses:
default:
description: No description provided.
headers: {}
content:
application/json: {}
"/good-route-scalar":
get:
operationId: getGoodRouteScalar
summary: a working route that returns a scalar value
deprecated: false
tags: []
security: []
parameters: []
responses:
default:
description: No description provided.
headers: {}
content:
application/json:
schema:
type: integer
"/good-route-hash":
get:
operationId: getGoodRouteHash
summary: a working route that returns a hash
deprecated: false
tags: []
security: []
parameters: []
responses:
default:
description: No description provided.
headers: {}
content:
application/json:
schema:
type: object
properties:
a:
type: string
b:
type: integer
"/good-route-struct":
get:
operationId: getGoodRouteStruct
summary: a working route that returns a hash through a Modern::Struct
deprecated: false
tags: []
security: []
parameters: []
responses:
default:
description: No description provided.
headers: {}
content:
application/json:
schema:
"$ref": "#/components/schemas/RespBody"
components:
schemas:
RetBody:
type: object
properties:
a:
type: integer
b:
type: integer
c:
type: integer
nullable: true
d:
anyOf:
- type: integer
- type: string
nullable: true
Subclass:
type: object
properties:
foo:
type: integer
ExclusiveSubA:
type: object
properties: {}
ExclusiveSubB:
type: object
properties: {}
Parent:
type: object
properties:
req:
type: string
opt:
type: string
nullable: true
optdef:
type: string
nullable: true
sub:
oneOf:
- "$ref": "#/components/schemas/Subclass"
exsub:
anyOf:
- oneOf:
- "$ref": "#/components/schemas/ExclusiveSubA"
- oneOf:
- "$ref": "#/components/schemas/ExclusiveSubB"
hash:
type: object
properties:
first:
type: string
last:
type: integer
nullable: true
array:
type: array
items:
oneOf:
- "$ref": "#/components/schemas/Subclass"
RespBody:
type: object
properties:
a:
type: string
b:
type: integer
responses: {}
parameters: {}
examples: {}
requestBodies: {}
securitySchemes:
httpBearerFoo:
description: a bearer token with the value of 'foo' is required.
type: http
scheme: Bearer
httpMultiBearerFoo:
type: http
scheme: Bearer
httpMultiNotBearerBar:
type: http
scheme: NotBearer
headerFoo:
name: X-Modern-Token
in: header
type: apiKey
links: {}
callbacks: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment