Added resolver, models and model utils.

This commit is contained in:
Dave Shanley
2022-07-18 09:42:46 -04:00
parent df710cb49d
commit 925220e8da
7 changed files with 90699 additions and 3 deletions

View File

@@ -0,0 +1,58 @@
paths:
/burgers:
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Nine'
components:
schemas:
One:
description: "test one"
properties:
things:
"$ref": "#/components/schemas/Two"
Two:
decription: "test two"
properties:
testThing:
"$ref": "#/components/schemas/One"
anyOf:
- "$ref": "#/components/schemas/Four"
Three:
description: "test three"
properties:
tester:
"$ref": "#/components/schemas/Four"
bester:
"$ref": "#/components/schemas/Seven"
yester:
"$ref": "#/components/schemas/Seven"
Four:
desription: "test four"
properties:
lemons:
"$ref": "#/components/schemas/Nine"
Five:
properties:
rice:
"$ref": "#/components/schemas/Six"
Six:
properties:
mints:
"$ref": "#/components/schemas/Nine"
Seven:
properties:
wow:
"$ref": "#/components/schemas/Three"
Nine:
description: done.
Ten:
properties:
yeah:
"$ref": "#/components/schemas/Ten"

90051
test_specs/k8s.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,241 @@
openapi: 3.0.1
info:
title: Burger Shop
description: |
The best burger API at quobix. You can find the testiest burgers on the world
termsOfService: https://quobix.com
contact:
name: quobix
license:
name: Quobix
version: "1.2"
tags:
- name: "pizza"
description: false
externalDocs:
description: "Find out more"
url: "https://quobix.com/"
- name: "Dressing"
description: "Variety of dressings: cheese, veggie, oil and a lot more"
externalDocs:
description: "Find out more information about our products)"
url: "https://quobix.com/"
servers:
- url: https://quobix.com/api
paths:
/burgers:
post:
operationId: createBurger
tags:
- "Meat"
summary: Create a new burger
description: A new burger for our menu, yummy yum yum.
requestBody:
description: Give us the new burger!
content:
application/json:
schema:
$ref: 'https://raw.githubusercontent.com/daveshanley/vacuum/main/model/test_files/burgershop.openapi.yaml#/components/schemas/Burger'
examples:
pbjBurger:
summary: A horrible, nutty, sticky mess.
value:
name: Peanut And Jelly
numPatties: 3
cakeBurger:
summary: A sickly, sweet, atrocity
value:
name: Chocolate Cake Burger
numPatties: 5
responses:
"200":
description: A tasty burger for you to eat.
content:
application/json:
schema:
$ref: 'https://raw.githubusercontent.com/daveshanley/vacuum/main/model/test_files/burgershop.openapi.yaml#/components/schemas/Burger'
examples:
quarterPounder:
summary: A juicy two handler sammich
value:
name: Quarter Pounder with Cheese
numPatties: 1
filetOFish:
summary: A tasty treat from the sea
value:
name: Filet-O-Fish
numPatties: 1
"500":
description: Unexpected error creating a new burger. Sorry.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unexpectedError:
summary: oh my goodness
value:
message: something went terribly wrong my friend, no new burger for you.
"422":
description: Unprocessable entity
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unexpectedError:
summary: invalid request
value:
message: unable to accept this request, looks bad, missing something.
/burgers/{burgerId}:
get:
operationId: locateBurger
tags:
- "Meat"
summary: Search a burger by ID - returns the burger with that identifier
description: Look up a tasty burger take it and enjoy it
parameters:
- in: path
name: burgerId
schema:
type: string
example: big-mac
description: the name of the burger. use this to order your food
required: true
responses:
"200":
description: A tasty burger for you to eat. Wide variety of products to choose from
content:
application/json:
schema:
$ref: 'https://raw.githubusercontent.com/daveshanley/vacuum/main/model/test_files/burgershop.openapi.yaml#/components/schemas/Fries'
examples:
quarterPounder:
summary: A juicy two handler sammich
value:
name: Quarter Pounder with Cheese
numPatties: 1
filetOFish:
summary: A tasty treat from the sea
value:
name: Filet-O-Fish
numPatties: 1
"404":
description: Cannot find your burger. Sorry. We may have sold out of this type
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
notFound:
summary: burger missing
value:
message: can't find a burger with that ID, we may have sold out my friend.
"500":
description: Unexpected error. Sorry.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
unexpectedError:
summary: oh my stars
value:
message: something went terribly wrong my friend, burger location crashed!
/burgers/{burgerId}/dressings:
get:
operationId: listBurgerDressings
tags:
- "Dressing"
summary: Get a list of all dressings available
description: Same as the summary, look up a tasty burger, by its ID - the burger identifier
parameters:
- in: path
name: burgerId
schema:
type: string
example: big-mac
description: the name of the our fantastic burger. You can pick a name from our menu
required: true
responses:
"200":
description: an array of
content:
application/json:
schema:
type: array
items:
$ref: 'test_files/burgershop.openapi.yaml#/components/schemas/Dressing'
"404":
description: Cannot find your burger in which to list dressings. Sorry
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
"500":
description: Unexpected error listing dressings for burger. Sorry.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/dressings/{dressingId}:
get:
operationId: getDressing
tags:
- "Dressing"
summary: Get a specific dressing - you can choose the dressing from our menu
description: Same as the summary, get a dressing, by its ID
parameters:
- in: path
name: dressingId
schema:
type: string
example: cheese
description: This is the unique identifier for the dressing items.
required: true
responses:
"404":
description: Cannot find your dressing, sorry.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
"500":
description: Unexpected error getting a dressing. Sorry.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/dressings:
get:
operationId: getAllDressings
tags:
- "Dressing"
summary: Get all dressings available in our store
description: Get all dressings and choose from them
responses:
"200":
description: an array of dressings
content:
application/json:
schema:
type: array
items:
$ref: 'test_files/burgershop.openapi.yaml#/components/schemas/Dressing'
"500":
description: Unexpected error. Sorry.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
Error:
type: object
description: Error defining what went wrong when providing a specification. The message should help indicate the issue clearly.
properties:
message:
type: string
description: returns the error message if something wrong happens
example: No such burger as 'Big-Whopper'