Skip to content

Commit 9435b7d

Browse files
committed
Some minor fixes to OpenAPI
1 parent b7db6e9 commit 9435b7d

File tree

5 files changed

+124
-29
lines changed

5 files changed

+124
-29
lines changed

fixed-spotify-open-api.yml

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2947,7 +2947,6 @@ paths:
29472947
type: boolean
29482948
description: |
29492949
**true**: ensure playback happens on new device.<br>**false** or not provided: keep the current playback state.
2950-
additionalProperties: true
29512950
responses:
29522951
"204":
29532952
description: Playback transferred
@@ -3051,22 +3050,22 @@ paths:
30513050
context_uri:
30523051
type: string
30533052
description: |
3054-
string
3055-
additionalProperties: true
3053+
Spotify URI of the context to play. Valid contexts are albums, artists, playlists. Example: {"context_uri": "spotify:album:1Je1IMUlBXcx1Fz0WE7oPT"}
30563054
uris:
30573055
type: array
30583056
description: |
3059-
Array of URIs
3057+
A JSON array of the Spotify track URIs to play. For example: {"uris": ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "spotify:track:1301WleyT98MSxVHPZCA6M"]}
30603058
items:
30613059
type: string
30623060
offset:
30633061
type: object
3064-
description: object
3062+
description: |
3063+
Indicates from where in the context playback should start. Only available when "context_uri" corresponds to an album or playlist object, or when the uris parameter is used. "position" is zero based and can't be negative. Example: "offset": {"position": 5} "uri" is a string representing the uri of the item to start at. Example: "offset": {"uri": "spotify:track:1301WleyT98MSxVHPZCA6M"}
30653064
additionalProperties: true
30663065
position_ms:
30673066
type: integer
3068-
description: integer
3069-
additionalProperties: true
3067+
description: |
3068+
Indicates from what position to start playback. Must be a positive number. Passing in a position that is greater than the length of the track will cause the player to start playing the next song.
30703069
responses:
30713070
"204":
30723071
description: Playback started
@@ -3491,20 +3490,7 @@ paths:
34913490
Get the list of markets where Spotify is available.
34923491
responses:
34933492
"200":
3494-
description: A markets object with an array of country codes
3495-
content:
3496-
application/json:
3497-
schema:
3498-
type: object
3499-
properties:
3500-
markets:
3501-
type: array
3502-
items:
3503-
type: string
3504-
example:
3505-
- CA
3506-
- BR
3507-
- IT
3493+
$ref: '#/components/responses/Markets'
35083494
"401":
35093495
$ref: '#/components/responses/Unauthorized'
35103496
"403":
@@ -3698,14 +3684,7 @@ components:
36983684
content:
36993685
application/json:
37003686
schema:
3701-
type: object
3702-
required:
3703-
- devices
3704-
properties:
3705-
devices:
3706-
type: array
3707-
items:
3708-
$ref: '#/components/schemas/DeviceObject'
3687+
$ref: '#/components/schemas/DevicesObject'
37093688
PagedAlbums:
37103689
description: A paged set of albums
37113690
content:
@@ -4004,6 +3983,21 @@ components:
40043983
snapshot_id:
40053984
type: string
40063985
example: abc
3986+
Markets:
3987+
description: A markets object with an array of country codes
3988+
content:
3989+
application/json:
3990+
schema:
3991+
type: object
3992+
properties:
3993+
markets:
3994+
type: array
3995+
items:
3996+
type: string
3997+
example:
3998+
- CA
3999+
- BR
4000+
- IT
40074001
AlbumsPagingObject:
40084002
description: Pages of albums
40094003
content:
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
description: Move markets to responses
2+
operations:
3+
- op: test
4+
path: "$.paths./markets.get.responses.200"
5+
value:
6+
description: A markets object with an array of country codes
7+
content:
8+
application/json:
9+
schema:
10+
type: object
11+
properties:
12+
markets:
13+
type: array
14+
items:
15+
type: string
16+
example: ["CA", "BR", "IT"]
17+
- op: set
18+
path: "$.paths./markets.get.responses.200"
19+
value:
20+
$ref: "#/components/responses/Markets"
21+
- op: put
22+
path: "$.components.responses"
23+
key: Markets
24+
value:
25+
description: A markets object with an array of country codes
26+
content:
27+
application/json:
28+
schema:
29+
type: object
30+
properties:
31+
markets:
32+
type: array
33+
items:
34+
type: string
35+
example: ["CA", "BR", "IT"]
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
description: remove wrong additionalProperties flag from body parameter
2+
operations:
3+
- op: test
4+
path: "$.paths./me/player/play.put.requestBody.content.application/json.schema.properties.context_uri.additionalProperties"
5+
value: true
6+
- op: delete
7+
path: "$.paths./me/player/play.put.requestBody.content.application/json.schema.properties.context_uri.additionalProperties"
8+
- op: test
9+
path: "$.paths./me/player/play.put.requestBody.content.application/json.schema.properties.context_uri.description"
10+
value: |
11+
string
12+
- op: set
13+
path: "$.paths./me/player/play.put.requestBody.content.application/json.schema.properties.context_uri.description"
14+
value: |
15+
Spotify URI of the context to play. Valid contexts are albums, artists, playlists. Example: {"context_uri": "spotify:album:1Je1IMUlBXcx1Fz0WE7oPT"}
16+
- op: test
17+
path: "$.paths./me/player/play.put.requestBody.content.application/json.schema.properties.uris.description"
18+
value: |
19+
Array of URIs
20+
- op: set
21+
path: "$.paths./me/player/play.put.requestBody.content.application/json.schema.properties.uris.description"
22+
value: |
23+
A JSON array of the Spotify track URIs to play. For example: {"uris": ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "spotify:track:1301WleyT98MSxVHPZCA6M"]}
24+
- op: test
25+
path: "$.paths./me/player/play.put.requestBody.content.application/json.schema.properties.offset.description"
26+
value: object
27+
- op: set
28+
path: "$.paths./me/player/play.put.requestBody.content.application/json.schema.properties.offset.description"
29+
value: |
30+
Indicates from where in the context playback should start. Only available when "context_uri" corresponds to an album or playlist object, or when the uris parameter is used. "position" is zero based and can't be negative. Example: "offset": {"position": 5} "uri" is a string representing the uri of the item to start at. Example: "offset": {"uri": "spotify:track:1301WleyT98MSxVHPZCA6M"}
31+
- op: test
32+
path: "$.paths./me/player/play.put.requestBody.content.application/json.schema.properties.position_ms.additionalProperties"
33+
value: true
34+
- op: delete
35+
path: "$.paths./me/player/play.put.requestBody.content.application/json.schema.properties.position_ms.additionalProperties"
36+
- op: test
37+
path: "$.paths./me/player/play.put.requestBody.content.application/json.schema.properties.position_ms.description"
38+
value: integer
39+
- op: set
40+
path: "$.paths./me/player/play.put.requestBody.content.application/json.schema.properties.position_ms.description"
41+
value: |
42+
Indicates from what position to start playback. Must be a positive number. Passing in a position that is greater than the length of the track will cause the player to start playing the next song.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
description: remove wrong additionalProperties flag from body parameter
2+
operations:
3+
- op: test
4+
path: "$.paths./me/player.put.requestBody.content.application/json.schema.properties.play.additionalProperties"
5+
value: true
6+
- op: delete
7+
path: "$.paths./me/player.put.requestBody.content.application/json.schema.properties.play.additionalProperties"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
description: Reuse DevicesObject for ManyDevices response
2+
operations:
3+
- op: test
4+
path: "$.components.responses.ManyDevices.content.application/json.schema"
5+
value:
6+
type: object
7+
required:
8+
- devices
9+
properties:
10+
devices:
11+
type: array
12+
items:
13+
$ref: '#/components/schemas/DeviceObject'
14+
- op: set
15+
path: "$.components.responses.ManyDevices.content.application/json.schema"
16+
value:
17+
$ref: '#/components/schemas/DevicesObject'

0 commit comments

Comments
 (0)