Repository navigation
Expand file tree
/
Copy pathpathfinder-spec.yml
More file actions
339 lines (339 loc) · 9.75 KB
/
Copy pathpathfinder-spec.yml
File metadata and controls
339 lines (339 loc) · 9.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
openapi: 3.0.3
info:
title: Spotify pathfinder (partial)
version: '1'
description: >-
Response models of pathfinder, Spotify's internal GraphQL service
(POST https://api-partner.spotify.com/pathfinder/v2/query), for the
persisted queries go-librespot sends. Spotify publishes no schema: these
were reversed from its answers, and only describe the fields go-librespot
reads. Every object may carry more fields, and any field may be missing or
null. Go models are generated from this file into pathfinder/; run
`go generate ./...` after changing it.
paths: {}
components:
schemas:
# The data object of every search operation: searchTracks, searchAlbums,
# searchArtists, searchPlaylists, searchPodcasts, searchFullEpisodes and
# searchSuggestions.
SearchData:
type: object
properties:
searchV2:
description: Absent when the answer is not a search result
x-go-type-skip-optional-pointer: false
allOf:
- $ref: '#/components/schemas/SearchResultV2'
SearchResultV2:
description: >-
One GraphQL type for every search operation; each operation selects
the field holding its results.
type: object
properties:
tracksV2:
description: Results of searchTracks
x-go-type-skip-optional-pointer: false
allOf:
- $ref: '#/components/schemas/SearchHitPage'
albumsV2:
description: Results of searchAlbums
x-go-type-skip-optional-pointer: false
allOf:
- $ref: '#/components/schemas/SearchPage'
artists:
description: Results of searchArtists
x-go-type-skip-optional-pointer: false
allOf:
- $ref: '#/components/schemas/SearchPage'
playlists:
description: Results of searchPlaylists
x-go-type-skip-optional-pointer: false
allOf:
- $ref: '#/components/schemas/SearchPage'
podcasts:
description: Results of searchPodcasts
x-go-type-skip-optional-pointer: false
allOf:
- $ref: '#/components/schemas/SearchPage'
episodes:
description: Results of searchFullEpisodes
x-go-type-skip-optional-pointer: false
allOf:
- $ref: '#/components/schemas/SearchPage'
topResultsV2:
description: Results of searchSuggestions
x-go-type-skip-optional-pointer: false
allOf:
- $ref: '#/components/schemas/TopResults'
PagingInfo:
type: object
properties:
nextOffset:
description: Offset of the next page, null on the last one
type: integer
nullable: true
x-go-type-skip-optional-pointer: false
SearchPage:
description: >-
One page of results. totalCount is an estimate: only
pagingInfo.nextOffset tells whether another page exists.
type: object
properties:
totalCount:
type: integer
pagingInfo:
$ref: '#/components/schemas/PagingInfo'
items:
type: array
items:
$ref: '#/components/schemas/EntityWrapper'
SearchHitPage:
description: A page of results whose items are hits, as in tracksV2
type: object
properties:
totalCount:
type: integer
pagingInfo:
$ref: '#/components/schemas/PagingInfo'
items:
type: array
items:
$ref: '#/components/schemas/SearchHit'
TopResults:
type: object
properties:
itemsV2:
type: array
items:
$ref: '#/components/schemas/SearchHit'
SearchHit:
description: >-
A result together with what matched (TopResultHit in topResultsV2).
type: object
properties:
item:
$ref: '#/components/schemas/EntityWrapper'
EntityWrapper:
description: >-
A response wrapper (TrackResponseWrapper, AlbumResponseWrapper…). Its
data is an entity, an error type such as GenericError, NotFound or
RestrictedContent, or null. In searchSuggestions a
SearchAutoCompleteEntity wrapper holds an AutoCompleteEntity instead.
type: object
properties:
__typename:
x-go-name: Typename
type: string
data:
description: Null when Spotify has nothing to show
nullable: true
allOf:
- $ref: '#/components/schemas/Entity'
AutoCompleteEntity:
description: A suggested complete query, in searchSuggestions
type: object
properties:
text:
type: string
# The members' __typename carries no x-go-name: oapi-codegen's union
# helpers set the discriminator field under its default Go name.
Entity:
description: A search result, told apart by its GraphQL type
oneOf:
- $ref: '#/components/schemas/Track'
- $ref: '#/components/schemas/Album'
- $ref: '#/components/schemas/Artist'
- $ref: '#/components/schemas/Playlist'
- $ref: '#/components/schemas/Podcast'
- $ref: '#/components/schemas/Episode'
discriminator:
propertyName: __typename
mapping:
Track: '#/components/schemas/Track'
Album: '#/components/schemas/Album'
Artist: '#/components/schemas/Artist'
Playlist: '#/components/schemas/Playlist'
Podcast: '#/components/schemas/Podcast'
Episode: '#/components/schemas/Episode'
Track:
type: object
required: [ __typename ]
properties:
__typename:
type: string
uri:
type: string
name:
type: string
duration:
$ref: '#/components/schemas/Duration'
albumOfTrack:
$ref: '#/components/schemas/AlbumOfTrack'
artists:
$ref: '#/components/schemas/ArtistRefs'
AlbumOfTrack:
type: object
properties:
uri:
type: string
name:
type: string
coverArt:
$ref: '#/components/schemas/ImageSet'
Album:
type: object
required: [ __typename ]
properties:
__typename:
type: string
uri:
type: string
name:
type: string
artists:
$ref: '#/components/schemas/ArtistRefs'
coverArt:
$ref: '#/components/schemas/ImageSet'
date:
$ref: '#/components/schemas/AlbumDate'
AlbumDate:
description: An album's release date, of which search gives the year alone
type: object
properties:
year:
type: integer
Artist:
type: object
required: [ __typename ]
properties:
__typename:
type: string
uri:
type: string
profile:
$ref: '#/components/schemas/ArtistProfile'
visuals:
$ref: '#/components/schemas/ArtistVisuals'
ArtistVisuals:
type: object
properties:
avatarImage:
$ref: '#/components/schemas/ImageSet'
ArtistProfile:
type: object
properties:
name:
type: string
ArtistRefs:
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/ArtistRef'
ArtistRef:
type: object
properties:
uri:
type: string
profile:
$ref: '#/components/schemas/ArtistProfile'
Playlist:
type: object
required: [ __typename ]
properties:
__typename:
type: string
uri:
type: string
name:
type: string
description:
type: string
images:
$ref: '#/components/schemas/PlaylistImages'
ownerV2:
$ref: '#/components/schemas/UserWrapper'
PlaylistImages:
type: object
properties:
items:
description: The playlist's image, in its first item
type: array
items:
$ref: '#/components/schemas/ImageSet'
UserWrapper:
type: object
properties:
data:
$ref: '#/components/schemas/User'
Podcast:
description: A show
type: object
required: [ __typename ]
properties:
__typename:
type: string
uri:
type: string
name:
type: string
coverArt:
$ref: '#/components/schemas/ImageSet'
publisher:
$ref: '#/components/schemas/Publisher'
Publisher:
type: object
properties:
name:
type: string
PodcastWrapper:
type: object
properties:
data:
$ref: '#/components/schemas/Podcast'
Episode:
type: object
required: [ __typename ]
properties:
__typename:
type: string
uri:
type: string
name:
type: string
coverArt:
$ref: '#/components/schemas/ImageSet'
duration:
$ref: '#/components/schemas/Duration'
podcastV2:
$ref: '#/components/schemas/PodcastWrapper'
User:
description: A playlist's owner
type: object
properties:
username:
type: string
ImageSet:
type: object
properties:
sources:
description: The image in several sizes
type: array
items:
$ref: '#/components/schemas/ImageSource'
ImageSource:
type: object
properties:
url:
type: string
width:
description: Width in pixels, null when unknown
type: integer
nullable: true
x-go-type-skip-optional-pointer: false
Duration:
type: object
properties:
totalMilliseconds:
type: integer