Add hal and problem JSON Schemas

This commit is contained in:
Jarzyna
2019-09-19 16:56:24 +02:00
parent 851484e54e
commit 5818628333
2 changed files with 87 additions and 0 deletions

68
hal.yaml Normal file
View File

@@ -0,0 +1,68 @@
# $id: http://supermodel.io/andrzej/hAL
# $schema: http://json-schema.org/draft-04/schema#
title: HAL
description: JSON Hypertext Application Language. Definition of [HAL message format](https://tools.ietf.org/html/draft-kelly-json-hal-08)
type: object
# required:
# - errorCauser
properties:
# errorCauser:
# type: string
_links:
type: object
additionalProperties:
anyOf:
- $ref: '#/definitions/halLinkObject'
- type: array
items:
- $ref: '#/definitions/halLinkObject'
properties:
curies:
anyOf:
- $ref: '#/definitions/halCuriesLink'
- type: array
items:
- $ref: '#/definitions/halCuriesLink'
_embedded:
type: object
additionalProperties:
anyOf:
- $ref: '#'
- type: array
items:
- $ref: '#'
definitions:
halLinkObject:
title: HAL Link Object
type: object
properties:
href:
type: string
templated:
type: boolean
type:
type: string
deprecation:
type: string
name:
type: string
profile:
type: string
title:
type: string
hreflang:
type: string
required:
- href
halCuriesLink:
title: HAL Curies Link
allOf:
- type: object
properties:
templated:
enum:
- true
required:
- templated
- $ref: '#/definitions/halLinkObject'

19
problem.yaml Normal file
View File

@@ -0,0 +1,19 @@
# $id: http://supermodel.io/adidas/api/ProblemDetail
# $schema: http://json-schema.org/draft-07/schema#
title: Problem Details for HTTP APIs
description: Definition of [RFC7807](https://tools.ietf.org/html/rfc7807) problem detail
type: object
properties:
type:
type: string
title:
type: string
status:
type: number
detail:
type: string
instance:
type: string
required:
- title
- detail