Skip to content

Instantly share code, notes, and snippets.

@AGhost-7
Created April 13, 2019 20:19
Show Gist options
  • Save AGhost-7/fe58ff1fb45b812e9196ae1494f59474 to your computer and use it in GitHub Desktop.
Save AGhost-7/fe58ff1fb45b812e9196ae1494f59474 to your computer and use it in GitHub Desktop.
openapi: "3.0.0"
info:
title: Leaps of Sounds
version: 2.0.0
paths:
/scales:
get:
summary: List all scales
parameters:
- name: system
in: query
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Scales'
post:
summary: submit scale
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Scale'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Scale'
/scales/{id}:
get:
summary: get single scale
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Scale'
delete:
summary: delete a single scale
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'204': {}
/tunings:
get:
summary: List all tunings
parameters:
- name: instrument
in: query
schema:
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/tunings'
post:
summary: submit tuning
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Tuning'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Tuning'
/tunings/{id}:
delete:
summary: Delete a tuning
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'204': {}
/instruments:
get:
summary: List all instruments
parameters:
- name: system
type: string
in: query
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Instruments'
post:
summary: Submit an instrument
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Instrument'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schema/Instrument'
/instruments/{id}:
delete:
summary: Delete and instrument
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'204': {}
'404': {}
components:
schemas:
# e.g., microtonal / maqam, western, etc.
System:
type: object
required:
- name
- tones
properties:
id:
type: string
updated_at:
type: string
format: date-time
name:
type: string
# octave is split into 12 for western, 24 for microtonal, etc.
tones:
type: integer
Scale:
type: object
required:
- name
- values
- system
properties:
id:
type: string
updated_at:
type: string
format: date-time
name:
type: string
values:
type: array
items:
type: number
system:
$ref: '#/components/schemas/System'
Scales:
type: object
properties:
total:
type: integer
page:
type: integer
items:
type: array
items:
$ref: '#/components/schemas/Scale'
Instrument:
type: object
required:
- name
- system
- strings
properties:
id:
type: string
name:
type: string
strings:
type: integer
system:
$ref: '#/components/schemas/System'
Instruments:
type: object
properties:
total:
type: integer
page:
type: integer
items:
type: array
items:
$ref: '#/components/schemas/Instrument'
Tuning:
type: object
required:
- name
- instrument
properties:
id:
type: string
updated_at:
type: string
format: date-time
name:
type: string
instrument:
$ref: '#/components/schemas/Instrument'
Tunings:
type: object
properties:
total:
type: integer
page:
type: integer
items:
type: array
items:
$ref: '#/components/schemas/Tuning'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment