Skip to content

Instantly share code, notes, and snippets.

@IntelOrca
Last active March 28, 2021 17:12
Show Gist options
  • Save IntelOrca/7a15f08961904710be25a2dc732263e2 to your computer and use it in GitHub Desktop.
Save IntelOrca/7a15f08961904710be25a2dc732263e2 to your computer and use it in GitHub Desktop.
{
"openapi": "3.0.1",
"info": {
"title": "Composition Library API Reference",
"description": "API reference for Composition Library.",
"termsOfService": "https://complib.org/terms",
"contact": {
"email": "support@complib.org"
},
"version": "1.0.0"
},
"servers": [
{
"url": "https://api.complib.org"
}
],
"tags": [
{
"name": "Methods",
"description": "Query and validate methods"
},
{
"name": "Compositions",
"description": "Query and validate compositions"
},
{
"name": "Collections",
"description": "Query collections"
}
],
"paths": {
"/method/{id}": {
"get": {
"tags": [
"Methods"
],
"summary": "Query a single method",
"parameters": [
{
"name": "id",
"in": "path",
"description": "Id of the method to fetch",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "accessKey",
"in": "query",
"description": "Access key for private methods",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Method"
}
}
}
},
"403": {
"description": "Restricted access to method",
"content": {}
},
"404": {
"description": "No method found",
"content": {}
}
}
}
},
"/method/{id}/rows": {
"get": {
"tags": [
"Methods"
],
"summary": "Query a single method's rows",
"parameters": [
{
"name": "id",
"in": "path",
"description": "Id of the method to fetch",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "accessKey",
"in": "query",
"description": "Access key for private methods",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MethodWithRows"
}
}
}
},
"403": {
"description": "Restricted access to method",
"content": {}
},
"404": {
"description": "No method found",
"content": {}
}
}
}
},
"/method/search": {
"get": {
"tags": [
"Methods"
],
"summary": "Query Methods",
"description": "Query methods with the given search criteria.",
"operationId": "methodSearch",
"parameters": [
{
"name": "title",
"in": "query",
"description": "Keywords found in the title",
"schema": {
"type": "string"
}
},
{
"name": "stage",
"in": "query",
"description": "Limit results to a specific stage",
"schema": {
"type": "integer"
}
},
{
"name": "minstage",
"in": "query",
"description": "Limit results to a minimum stage",
"schema": {
"type": "integer"
}
},
{
"name": "maxstage",
"in": "query",
"description": "Limit results to a maximum stage",
"schema": {
"type": "integer"
}
},
{
"name": "page",
"in": "query",
"description": "The page index",
"schema": {
"type": "integer",
"default": 1
}
},
{
"name": "perpage",
"in": "query",
"description": "The number of results per page",
"schema": {
"type": "integer",
"default": 25
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"count": {
"type": "integer",
"example": 1
},
"page": {
"type": "integer",
"example": 1
},
"perpage": {
"type": "integer",
"example": 25
},
"methods": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Method"
}
}
}
}
}
}
},
"400": {
"description": "Invalid status value",
"content": {}
}
}
}
},
"/method/validate": {
"get": {
"tags": [
"Methods"
],
"summary": "Validate and classify a method from a place notation",
"parameters": [
{
"name": "name",
"in": "query",
"description": "Name of the method",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "stage",
"in": "query",
"description": "Stage of the method",
"required": true,
"schema": {
"type": "number"
}
},
{
"name": "placeNotation",
"in": "query",
"description": "The place notation of the method",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "divisionEnds",
"in": "query",
"description": "???",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"method": {
"$ref": "#/components/schemas/Method"
},
"properties": {
"$ref": "#/components/schemas/MethodProperties"
},
"messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"example": "error",
"enum": [
"error",
"warning",
"information"
]
},
"message": {
"type": "string",
"example": "title already used for Cambridge Surprise Major -38-14-1258-36-14-58-16-78,12."
}
}
}
}
}
}
}
}
},
"403": {
"description": "Restricted access to method",
"content": {}
},
"404": {
"description": "No method found",
"content": {}
}
}
}
},
"/composition/{id}": {
"get": {
"tags": [
"Compositions"
],
"summary": "Query a single composition",
"parameters": [
{
"name": "id",
"in": "path",
"description": "Id of the composition to fetch",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "accessKey",
"in": "query",
"description": "Access key for querying private compositions",
"schema": {
"type": "string"
}
},
{
"name": "substitutedmethodid",
"in": "query",
"description": "Id of the method to substitute",
"schema": {
"type": "integer"
}
},
{
"name": "methodAccessKey",
"in": "query",
"description": "Access key for the method when querying composition substituted with a private method",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Composition"
}
}
}
},
"403": {
"description": "Restricted access to the substituted method or composition",
"content": {}
},
"404": {
"description": "Substituted method or composition not found",
"content": {}
}
}
}
},
"/composition/{id}/rows": {
"get": {
"tags": [
"Compositions"
],
"summary": "Query a single composition's rows",
"parameters": [
{
"name": "id",
"in": "path",
"description": "Id of the composition to fetch",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "accessKey",
"in": "query",
"description": "Access key for querying private compositions",
"schema": {
"type": "string"
}
},
{
"name": "substitutedmethodid",
"in": "query",
"description": "Id of the method to substitute",
"schema": {
"type": "integer"
}
},
{
"name": "methodAccessKey",
"in": "query",
"description": "Access key for the method when querying composition substituted with a private method",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CompositionWithRows"
}
}
}
},
"403": {
"description": "Restricted access to method",
"content": {}
},
"404": {
"description": "No method found",
"content": {}
}
}
}
},
"/composition/search": {
"get": {
"tags": [
"Compositions"
],
"summary": "Query compositions",
"description": "Query compositions with the given search criteria.",
"parameters": [
{
"name": "title",
"in": "query",
"description": "Keywords found in the title",
"schema": {
"type": "string"
}
},
{
"name": "stage",
"in": "query",
"description": "Limit results to a specific stage",
"schema": {
"type": "integer"
}
},
{
"name": "minstage",
"in": "query",
"description": "Limit results to a minimum stage",
"schema": {
"type": "integer"
}
},
{
"name": "maxstage",
"in": "query",
"description": "Limit results to a maximum stage",
"schema": {
"type": "integer"
}
},
{
"name": "page",
"in": "query",
"description": "The page index",
"schema": {
"type": "integer",
"default": 1
}
},
{
"name": "perpage",
"in": "query",
"description": "The number of results per page",
"schema": {
"type": "integer",
"default": 25
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"count": {
"type": "integer",
"example": 1
},
"page": {
"type": "integer",
"example": 1
},
"perpage": {
"type": "integer",
"example": 25
},
"compositions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Composition"
}
}
}
}
}
}
}
}
}
},
"/collection/{id}": {
"get": {
"tags": [
"Collections"
],
"summary": "Query a single collection",
"parameters": [
{
"name": "id",
"in": "path",
"description": "Id of the collection to fetch",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "accessKey",
"in": "query",
"description": "Access key for private collections",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Collection"
}
}
}
},
"403": {
"description": "Restricted access to method",
"content": {}
},
"404": {
"description": "No method found",
"content": {}
}
}
}
},
"/collection/search": {
"get": {
"tags": [
"Collections"
],
"summary": "Query collections",
"description": "Query collections with the given search criteria.",
"parameters": [
{
"name": "title",
"in": "query",
"description": "Keywords found in the title",
"schema": {
"type": "string"
}
},
{
"name": "volume",
"in": "query",
"description": "Limit results to a specific volume",
"schema": {
"type": "integer"
}
},
{
"name": "collectiontype",
"in": "query",
"description": "Limit results to a specific collection type",
"schema": {
"type": "string",
"enum": [
"Mixed",
"Composition",
"Method",
"Performance",
"Composer"
],
"default": "Mixed"
}
},
{
"name": "page",
"in": "query",
"description": "The page index",
"schema": {
"type": "integer",
"default": 1
}
},
{
"name": "perpage",
"in": "query",
"description": "The number of results per page",
"schema": {
"type": "integer",
"default": 25
}
}
],
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"count": {
"type": "integer",
"example": 1
},
"page": {
"type": "integer",
"example": 1
},
"perpage": {
"type": "integer",
"example": 25
},
"collections": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 10814
},
"library": {
"type": "string",
"example": "Public"
},
"title": {
"type": "string",
"example": "Handbell Stadium"
},
"volume": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Rows": {
"type": "array",
"description": "An array, where each element is an array of 3 elements. Where the 3 elements represent; the row, the spoken call, and the row flags respectively.",
"items": {
"type": "array",
"example": [
[
"12345678",
"Go Cambridge Surprise Major",
"8"
],
[
"12345678",
"",
"16"
],
[
"21436587",
"",
"8"
],
[
"12463857",
"",
"4"
]
],
"items": {
"type": "string",
"example": ""
}
}
},
"Method": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 16694
},
"library": {
"type": "string",
"example": "CCCBR"
},
"title": {
"type": "string",
"example": "Cambridge Surprise Major"
},
"name": {
"type": "string",
"example": "Cambridge"
},
"stage": {
"type": "integer",
"example": 8
}
}
},
"MethodWithRows": {
"allOf": [
{
"$ref": "#/components/schemas/Method"
},
{
"type": "object",
"properties": {
"rows": {
"$ref": "#/components/schemas/Rows"
}
}
}
]
},
"MethodProperties": {
"type": "object",
"properties": {
"leadHead": {
"type": "string",
"example": "15738264"
},
"leadheadCode": {
"type": "string",
"example": "b"
}
},
"example": {
"leadHead": "15738264",
"leadheadCode": "b",
"fchGroups": "BDEe",
"plainCourseLength": 224,
"leadLength": 32,
"leadsInCourse": 7,
"numberOfHuntBells": 1,
"numberOfWorkingBells": 7,
"numberOfStationaryBells": 0,
"numberOfPrimaryHunts": 1,
"numberOfSecondaryHunts": 0,
"numberOfConsecutiveBlows": 2,
"flags": {
"flagCollection": 654989952033,
"adjacentChanges": true,
"identityChanges": false,
"jumpChanges": false,
"static": true,
"dynamic": false,
"principle": false,
"hunter": true,
"singleHunt": true,
"multipleHunt": false,
"allHunt": false,
"monocyclic": true,
"isocyclic": false,
"differential": false,
"plain": false,
"place": false,
"bob": false,
"single": false,
"trebleDodging": true,
"trebleBob": false,
"delight": false,
"surprise": true,
"alliance": false,
"treblePlace": false,
"hybrid": false,
"little": false,
"asymmetric": false,
"palindromic": true,
"double": false,
"rotational": false,
"offset": false,
"plainBobLeadhead": true,
"grandsireLeadhead": false,
"originalLeadhead": false,
"cyclicLeadhead": false,
"roundsLeadhead": false,
"plainCourseIsTrue": true,
"leadIsTrue": true,
"rightPlace": true,
"unevenParity": false,
"layered": false,
"divisibleLead": false,
"hasDivisions": false,
"block": false,
"slowCourse": false
}
}
},
"Composition": {
"type": "object",
"example": {
"id": 10302,
"library": "Public",
"derivedTitle": "1260 2-Spliced Bob Minor by Graham A C John",
"title": "1260 2-Spliced Minor",
"opus": "",
"composerDetails": [
{
"role": "Composer",
"name": "Graham A C John"
}
],
"methodDetails": "Contains 900 Plain; 360 Little; 17 com; atw.",
"stage": 6,
"backstrokeStart": false,
"partheads": [
"134256",
"124356"
],
"courseheadMasks": [
"xxxxx6"
],
"startRowIndex": 0,
"extents": 2,
"callDefaultSpecifier": "near",
"calling": "6(–W –H –W sH sW sW ±3|6[sH,–H])",
"callDefinitions": [],
"methodCalling": "6(P P P P P P P P P P L L ±2|4|6[L L L L L,P P P P P] L L L)",
"methodDefinitions": [
{
"name": "Plain",
"rowStage": 6,
"methodStage": 6,
"placeNotation": "-16-16-16,12",
"methodPlaceNotation": "-16-16-16,12",
"divisionEnds": "",
"title": "Plain Bob Minor",
"mnemonic": "P",
"placeNotationOffset": 0,
"placeNotationLength": 12,
"startingPlace": 0,
"rotatedBy": 0,
"leadPositions": [
{
"name": "LE",
"position": 12
}
]
},
{
"name": "",
"rowStage": 6,
"methodStage": 6,
"placeNotation": "-16-14,12",
"methodPlaceNotation": "-16-14,12",
"divisionEnds": "",
"title": "Little Bob Minor",
"mnemonic": "L",
"placeNotationOffset": 0,
"placeNotationLength": 8,
"startingPlace": 0,
"rotatedBy": 0,
"leadPositions": [
{
"name": "LE",
"position": 8
}
]
}
],
"notes": ""
}
},
"CompositionWithRows": {
"allOf": [
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 10302
},
"methodid": {
"type": "integer",
"example": null
},
"title": {
"type": "string",
"example": "1260 2-Spliced Bob Minor by Graham A C John"
},
"stage": {
"type": "integer",
"example": 6
},
"callingnotes": {
"type": "string",
"example": null
}
}
},
{
"type": "object",
"properties": {
"rows": {
"$ref": "#/components/schemas/Rows"
}
}
}
]
},
"Collection": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 10814
},
"library": {
"type": "string",
"example": "Public"
},
"title": {
"type": "string",
"example": "Handbell Stadium"
},
"volume": {
"type": "string",
"example": ""
},
"entries": {
"type": "array",
"items": {
"type": "object",
"example": {
"entryType": "Method",
"methodId": 27946,
"compositionId": null,
"performanceId": null,
"personId": null,
"rolePerson": null,
"title": "Original Minor",
"chapter": "Minor",
"page": null,
"reference": "",
"sequence": 6010,
"accessKey": "adcef133e369236e0a75168462472e5cfbeb6b72",
"substitutedMethodAccessKey": null
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment