Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Siren definitions for Open API Specification
swagger: '2.0'
info:
title: Siren API
description: Template for a Siren API
version: '0.1.0'
schemes:
- http
- https
basePath: /
produces:
- application/vnd.siren+json
paths:
/:
get:
summary: Root
responses:
200:
description: The root of the API.
schema:
$ref: '#/definitions/RootResponse'
definitions:
RootResponse:
type: object
allOf:
- $ref: '#/definitions/Entity'
- properties:
properties:
$ref: '#/definitions/RootProperties'
RootProperties:
type: object
properties:
name:
type: string
# Siren base models
Entity:
type: object
properties:
class:
type: array
items:
type: string
entities:
type: array
items:
$ref: '#/definitions/SubEntity'
actions:
type: array
items:
$ref: '#/definitions/Action'
links:
type: array
items:
$ref: '#/definitions/Link'
SubEntity:
type: object
properties:
href:
type: string
rel:
type: array
items:
type: string
class:
type: array
items:
type: string
properties:
type: object
entities:
type: array
items:
$ref: '#/definitions/SubEntity'
actions:
type: array
items:
$ref: '#/definitions/Action'
links:
type: array
items:
$ref: '#/definitions/Link'
Action:
type: object
required:
- name
- href
properties:
class:
type: array
items:
type: string
name:
type: string
method:
type: string
href:
type: string
title:
type: string
type:
type: string
fields:
type: array
items:
$ref: '#/definitions/Field'
Field:
type: object
required:
- name
properties:
name:
type: string
type:
type: string
enum:
- hidden
- text
- search
- tel
- url
- email
- password
- datetime
- date
- month
- week
- time
- datetime-local
- number
- range
- color
- checkbox
- radio
- file
title:
type: string
value:
type: string
Link:
type: object
required:
- rel
- href
properties:
class:
type: array
items:
type: string
title:
type: string
rel:
type: array
items:
type: string
href:
type: string
type:
type: string
openapi: '3.0.0'
info:
title: Siren API
description: Template for a Siren API
version: '0.2.0'
contact:
name: Kevin Swiber
url: https://twitter.com/kevinswiber
email: kswiber+openapi@gmail.com
externalDocs:
description: The Siren specification.
url: http://sirenspec.org
schemes:
- http
- https
basePath: /
paths:
/:
get:
summary: Root
responses:
'200':
description: The root of the API.
content:
'application/vnd.siren+json':
schema:
$ref: '#/definitions/RootResponse'
components:
definitions:
RootResponse:
type: object
allOf:
- $ref: '#/definitions/Entity'
- properties:
properties:
$ref: '#/definitions/RootProperties'
RootProperties:
type: object
properties:
name:
type: string
# Siren base models
Entity:
type: object
properties:
class:
type: array
items:
type: string
entities:
type: array
items:
$ref: '#/definitions/SubEntity'
actions:
type: array
items:
$ref: '#/definitions/Action'
links:
type: array
items:
$ref: '#/definitions/Link'
SubEntity:
type: object
properties:
href:
type: string
rel:
type: array
items:
type: string
class:
type: array
items:
type: string
properties:
type: object
entities:
type: array
items:
$ref: '#/definitions/SubEntity'
actions:
type: array
items:
$ref: '#/definitions/Action'
links:
type: array
items:
$ref: '#/definitions/Link'
Action:
type: object
required:
- name
- href
properties:
class:
type: array
items:
type: string
name:
type: string
method:
type: string
href:
type: string
title:
type: string
type:
type: string
fields:
type: array
items:
$ref: '#/definitions/Field'
Field:
type: object
required:
- name
properties:
name:
type: string
type:
type: string
enum:
- hidden
- text
- search
- tel
- url
- email
- password
- datetime
- date
- month
- week
- time
- datetime-local
- number
- range
- color
- checkbox
- radio
- file
title:
type: string
value:
type: string
Link:
type: object
required:
- rel
- href
properties:
class:
type: array
items:
type: string
title:
type: string
rel:
type: array
items:
type: string
href:
type: string
type:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.