Skip to content

Instantly share code, notes, and snippets.

@ratpik
Created January 21, 2022 12:46
Show Gist options
  • Save ratpik/9b189e030a52b1f506f6fca0c69a9271 to your computer and use it in GitHub Desktop.
Save ratpik/9b189e030a52b1f506f6fca0c69a9271 to your computer and use it in GitHub Desktop.
JSON Schema Examples
#Reference - https://github.com/json-schema-org/json-schema-spec/issues/348#issuecomment-322940347
folderDeleted:
allOf:
- $ref: '#/components/schemas/folderCommon'
properties:
deletedCollectionItems:
type: array
items:
$ref: '#/components/schemas/collectionItem'
folderCommon:
type: object
properties:
id:
type: string
description: The id of the Request
name:
type: string
description: The name of the Request
timestamp:
type: string
format: date-time
description: The approx time of the event
# The parent is specific to the Activity feed use case
parent:
$ref: '#/components/schemas/collectionItem'
actor:
$ref: '#/components/schemas/actor'
collectionItem:
type: object
properties:
id:
type: string
description: The id of the item
type:
type: string
actor:
type: object
required:
- id
properties:
id:
type: integer
enum:
- folder
- request
- collection
- response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment