Skip to content

Instantly share code, notes, and snippets.

@jgornick
Created November 13, 2017 18:45
Show Gist options
  • Save jgornick/0399c2f85e8742d369500a97501b14b7 to your computer and use it in GitHub Desktop.
Save jgornick/0399c2f85e8742d369500a97501b14b7 to your computer and use it in GitHub Desktop.
---
definitions:
# Link
LinkObject:
type: object
required:
- href
properties:
href:
type: string
meta:
$ref: "#/definitions/MetaObject"
# Links
LinksObject:
allOf:
- type: object
properties:
self:
$ref: "#/definitions/LinkObject"
- $ref: "#/definitions/PaginationLinks"
# Meta
MetaObject:
type: object
# Error
ErrorObject:
type: object
properties:
id:
type: string
description: a unique identifier for this particular occurrence of the problem.
links:
allOf:
- $ref: "#/definitions/LinksObject"
- type: object
properties:
about:
allOf:
- $ref: "#/definitions/LinkObject"
- type: object
description: a link that leads to further details about this particular occurrence of the problem.
status:
type: string
description: the HTTP status code applicable to this problem, expressed as a string value.
code:
type: string
description: an application-specific error code, expressed as a string value.
description:
type: string
description: a short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
detail:
type: string
description: a human-readable explanation specific to this occurrence of the problem. Like description, this field's value can be localized.
source:
type: object
properties:
pointer:
type: string
description: a JSON Pointer [RFC6901] to the associated entity in the request document [e.g. "/data" for a primary data object, or "/data/attributes/description" for a specific attribute].
parameter:
type: string
description: a string indicating which URI query parameter caused the error.
meta:
allOf:
- $ref: "#/definitions/MetaObject"
- type: object
description: a meta object containing non-standard meta-information about the error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment