Skip to content

Commit 75cfe27

Browse files
committedMar 11, 2024·
fix(api): API specification v2.20.1
* Keep `rights` property optional on `ScoreDetails`
1 parent e15478f commit 75cfe27

File tree

1 file changed

+86
-87
lines changed

1 file changed

+86
-87
lines changed
 

‎spec/openapi.yaml

+86-87
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ info:
3333
name: Flat
3434
url: https://flat.io/developers/docs/api/
3535
email: developers@flat.io
36-
version: 2.20.0
36+
version: 2.20.1
3737
x-logo:
3838
url: https://prod.flat-cdn.com/img/logo-flat.svg
3939
servers:
@@ -124,37 +124,37 @@ paths:
124124
- account.public_profile
125125
- account.education_profile
126126
x-codeSamples:
127-
- lang: 'Python'
128-
source: |
129-
from pprint import pprint
130-
import os
127+
- lang: Python
128+
source: |
129+
from pprint import pprint
130+
import os
131131
132-
import flat_api
133-
from flat_api.rest import ApiException
132+
import flat_api
133+
from flat_api.rest import ApiException
134134
135-
configuration = flat_api.Configuration()
136-
configuration.access_token = os.environ['FLAT_ACCESS_TOKEN']
137-
flat_api_client = flat_api.ApiClient(configuration)
138-
try:
139-
pprint(flat_api.AccountApi(flat_api_client).get_authenticated_user())
140-
except ApiException as e:
141-
print(e)
142-
- lang: 'PHP'
143-
source: |
144-
<?php
145-
require_once(__DIR__ . '/vendor/autoload.php');
135+
configuration = flat_api.Configuration()
136+
configuration.access_token = os.environ['FLAT_ACCESS_TOKEN']
137+
flat_api_client = flat_api.ApiClient(configuration)
138+
try:
139+
pprint(flat_api.AccountApi(flat_api_client).get_authenticated_user())
140+
except ApiException as e:
141+
print(e)
142+
- lang: PHP
143+
source: |
144+
<?php
145+
require_once(__DIR__ . '/vendor/autoload.php');
146146
147-
// Configure OAuth2 access token
148-
Flat\APIClient\Configuration::getDefaultConfiguration()->setAccessToken($_ENV['FLAT_ACCESS_TOKEN']);
147+
// Configure OAuth2 access token
148+
Flat\APIClient\Configuration::getDefaultConfiguration()->setAccessToken($_ENV['FLAT_ACCESS_TOKEN']);
149149
150-
$api = new Flat\APIClient\Api\AccountApi();
150+
$api = new Flat\APIClient\Api\AccountApi();
151151
152-
try {
153-
$result = $api->getAuthenticatedUser();
154-
print_r($result);
155-
} catch (Exception $e) {
156-
echo 'Exception when calling AccountApi->getAuthenticatedUser: ', $e->getMessage(), PHP_EOL;
157-
}
152+
try {
153+
$result = $api->getAuthenticatedUser();
154+
print_r($result);
155+
} catch (Exception $e) {
156+
echo 'Exception when calling AccountApi->getAuthenticatedUser: ', $e->getMessage(), PHP_EOL;
157+
}
158158
/scores:
159159
post:
160160
tags:
@@ -213,75 +213,75 @@ paths:
213213
- scores
214214
x-codegen-request-body-name: body
215215
x-codeSamples:
216-
- lang: 'Ruby'
217-
source: |
218-
require 'flat_api'
219-
FlatApi.configure do |config|
220-
config.access_token = 'your_access_token'
221-
end
222-
begin
223-
score_data = File.open("my-score.musicxml", "r:UTF-8") { |f| f.read }
224-
body = FlatApi::ScoreCreationFileImport.new({
225-
title: 'Score Title',
226-
data: score_data,
227-
})
228-
p FlatApi::ScoreApi.new.create_score(body)
229-
rescue FlatApi::ApiError => e
230-
puts "Error when calling ScoreApi->create_score: #{e}"
231-
end
232-
- lang: 'Python'
233-
source: |
234-
from pprint import pprint
235-
import os
236-
from urllib.request import urlopen
237-
from urllib.error import HTTPError
216+
- lang: Ruby
217+
source: |
218+
require 'flat_api'
219+
FlatApi.configure do |config|
220+
config.access_token = 'your_access_token'
221+
end
222+
begin
223+
score_data = File.open("my-score.musicxml", "r:UTF-8") { |f| f.read }
224+
body = FlatApi::ScoreCreationFileImport.new({
225+
title: 'Score Title',
226+
data: score_data,
227+
})
228+
p FlatApi::ScoreApi.new.create_score(body)
229+
rescue FlatApi::ApiError => e
230+
puts "Error when calling ScoreApi->create_score: #{e}"
231+
end
232+
- lang: Python
233+
-forrce: |
234+
from pprint import pprint
235+
import os
236+
from urllib.request import urlopen
237+
from urllib.error import HTTPError
238238
239-
import flat_api
240-
from flat_api.rest import ApiException
239+
import flat_api
240+
from flat_api.rest import ApiException
241241
242-
SCORE_TO_IMPORT='https://gist.githubusercontent.com/gierschv/938479bec2bbe8c39eebbc9e19d027a0/raw/2caa4fa312184412d0d544feb361f918869ceaa5/hello-world.xml'
242+
SCORE_TO_IMPORT='https://gist.githubusercontent.com/gierschv/938479bec2bbe8c39eebbc9e19d027a0/raw/2caa4fa312184412d0d544feb361f918869ceaa5/hello-world.xml'
243243
244-
configuration = flat_api.Configuration()
245-
configuration.access_token = os.environ['FLAT_ACCESS_TOKEN']
246-
flat_api_client = flat_api.ApiClient(configuration)
244+
configuration = flat_api.Configuration()
245+
configuration.access_token = os.environ['FLAT_ACCESS_TOKEN']
246+
flat_api_client = flat_api.ApiClient(configuration)
247247
248-
try:
249-
# Download a MusicXML "Hello World"
250-
hello_world = urlopen(SCORE_TO_IMPORT).read().decode('utf-8')
248+
try:
249+
# Download a MusicXML "Hello World"
250+
hello_world = urlopen(SCORE_TO_IMPORT).read().decode('utf-8')
251251
252-
# The new score meta, including the MusicXML file as `data`
253-
new_score = flat_api.ScoreCreation(
254-
title='Hello World',
255-
privacy='private',
256-
data=hello_world
257-
)
252+
# The new score meta, including the MusicXML file as `data`
253+
new_score = flat_api.ScoreCreation(
254+
title='Hello World',
255+
privacy='private',
256+
data=hello_world
257+
)
258258
259-
# Create the document and print the meta returned by the API
260-
pprint(flat_api.ScoreApi(flat_api_client).create_score(new_score))
261-
except (ApiException, HTTPError) as e:
262-
print(e)
263-
- lang: 'PHP'
264-
source: |
265-
<?php
266-
require_once(__DIR__ . '/vendor/autoload.php');
259+
# Create the document and print the meta returned by the API
260+
pprint(flat_api.ScoreApi(flat_api_client).create_score(new_score))
261+
except (ApiException, HTTPError) as e:
262+
print(e)
263+
- lang: PHP
264+
source: |
265+
<?php
266+
require_once(__DIR__ . '/vendor/autoload.php');
267267
268-
// Configure OAuth2 access token
269-
Flat\APIClient\Configuration::getDefaultConfiguration()->setAccessToken($_ENV['FLAT_ACCESS_TOKEN']);
268+
// Configure OAuth2 access token
269+
Flat\APIClient\Configuration::getDefaultConfiguration()->setAccessToken($_ENV['FLAT_ACCESS_TOKEN']);
270270
271-
$musicXml = file_get_contents('https://gist.githubusercontent.com/gierschv/938479bec2bbe8c39eebbc9e19d027a0/raw/2caa4fa312184412d0d544feb361f918869ceaa5/hello-world.xml');
271+
$musicXml = file_get_contents('https://gist.githubusercontent.com/gierschv/938479bec2bbe8c39eebbc9e19d027a0/raw/2caa4fa312184412d0d544feb361f918869ceaa5/hello-world.xml');
272272
273-
try {
274-
$body = new \Flat\APIClient\Model\ScoreCreation();
275-
$body->setTitle('Hello world');
276-
$body->setPrivacy('private');
277-
$body->setData($musicXml);
273+
try {
274+
$body = new \Flat\APIClient\Model\ScoreCreation();
275+
$body->setTitle('Hello world');
276+
$body->setPrivacy('private');
277+
$body->setData($musicXml);
278278
279-
$scoreApi = new Flat\APIClient\Api\ScoreApi();
280-
$result = $scoreApi->createScore($body);
281-
print_r($result);
282-
} catch (Exception $e) {
283-
echo 'Exception when calling ScoreApi->createScore: ', $e->getMessage(), PHP_EOL;
284-
}
279+
$scoreApi = new Flat\APIClient\Api\ScoreApi();
280+
$result = $scoreApi->createScore($body);
281+
print_r($result);
282+
} catch (Exception $e) {
283+
echo 'Exception when calling ScoreApi->createScore: ', $e->getMessage(), PHP_EOL;
284+
}
285285
/scores/{score}:
286286
parameters:
287287
- name: score
@@ -4918,7 +4918,6 @@ components:
49184918
- type: object
49194919
required:
49204920
- creationDate
4921-
- rights
49224921
- collaborators
49234922
- instruments
49244923
- samples

0 commit comments

Comments
 (0)
Please sign in to comment.