Skip to content

Commit dc1d50c

Browse files
committed
feat: add create score ruby sample
1 parent b2b607d commit dc1d50c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

spec/openapi.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,23 @@ paths:
180180
- OAuth2:
181181
- scores
182182
x-codegen-request-body-name: body
183+
x-codeSamples:
184+
- lang: 'Ruby'
185+
source: |
186+
require 'flat_api'
187+
FlatApi.configure do |config|
188+
config.access_token = ''
189+
end
190+
begin
191+
score_data = File.open("my-score.musicxml", "r:UTF-8") { |f| f.read }
192+
body = FlatApi::ScoreCreationFileImport.new({
193+
title: 'Score Title',
194+
data: score_data,
195+
})
196+
p FlatApi::ScoreApi.new.create_score(body)
197+
rescue FlatApi::ApiError => e
198+
puts "Error when calling ScoreApi->create_score: #{e}"
199+
end
183200
/scores/{score}:
184201
parameters:
185202
- name: score

0 commit comments

Comments
 (0)