Skip to content

Commit

Permalink
# A New Story Is Being Told!
Browse files Browse the repository at this point in the history
Signed-off-by: Theo Truong <theotr@amazon.com>
  • Loading branch information
nhtruong committed May 21, 2024
1 parent 9013205 commit 9d0b528
Show file tree
Hide file tree
Showing 17 changed files with 1,655 additions and 4 deletions.
138 changes: 138 additions & 0 deletions json_schemas/story.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
$schema: http://json-schema.org/draft-07/schema#

type: object
properties:
$schema:
type: string
skipped:
type: boolean
description: If true, the story will be skipped.
default: false
description:
type: string
prologues:
type: array
items:
$ref: '#/definitions/SupplementalChapter'
epilogues:
type: array
items:
$ref: '#/definitions/SupplementalChapter'
chapters:
type: array
items:
$ref: '#/definitions/Chapter'
minItems: 1
required: [ description, chapters, prologues, epilogues]
additionalProperties: false

definitions:
Chapter:
type: object
allOf:
- $ref: '#/definitions/ChapterRequest'
- properties:
synopsis:
type: string
description: A brief description of the chapter.
response:
$ref: '#/definitions/ExpectedResponse'
required: [ synopsis ]
additionalProperties: false

ReadChapter:
allOf:
- $ref: '#/definitions/Chapter'
- type: object
properties:
response:
$ref: '#/definitions/ActualResponse'
required: [ response ]
additionalProperties: false

SupplementalChapter:
allOf:
- $ref: '#/definitions/ChapterRequest'
- type: object
properties:
ignore_errors:
description: If true, treat all non-2XX responses as successful.
type: boolean
default: false

ChapterRequest:
type: object
properties:
path:
type: string
method:
type: string
enum: [ GET, PUT, POST, DELETE, PATCH, HEAD, OPTIONS ]
parameters:
type: object
additionalProperties:
$ref: '#/definitions/Parameter'
requestBody:
$ref: '#/definitions/RequestBody'
required: [ path, method ]
additionalProperties: false


RequestBody:
type: object
properties:
content_type:
type: string
payload:
$ref: '#/definitions/Payload'
required: [ content_type, payload ]
additionalProperties: false

ExpectedResponse:
type: object
properties:
status:
type: integer
description: The expected HTTP status code. Default to 200.
default: 200
content_type:
type: string
payload:
$ref: '#/definitions/Payload'
required: [ status ]
additionalProperties: false

ActualResponse:
type: object
properties:
status:
type: integer
content_type:
type: string
payload:
$ref: '#/definitions/Payload'
message:
type: string
description: Error message for non 2XX responses.
required: [ status, content_type, payload ]
additionalProperties: false

Payload:
anyOf:
- type: object
- type: array
- type: string
- type: number
- type: boolean

Parameter:
anyOf:
- type: array
items:
oneOf:
- type: string
- type: number
- type: boolean
- type: string
- type: number
- type: boolean
Loading

0 comments on commit 9d0b528

Please sign in to comment.