Open miniBill opened 1 year ago
(that response is also missing linked_from
and is_playable
, and some fields inside the authors too)
Hi @miniBill, thanks for opening this issue. I am only adding patches on top of the official OpenAPI spec from Spotify. Unfortunately, the official spec does not provide this info. Manually adding this info without knowing the actual internals of the backing services, would be really costly and difficult. Therefore I can not currently provide this information.
This issue is quite similar to #113
It kinda does tho? Notice the required
vs lack of it? [got from https://developer.spotify.com/documentation/web-api/reference/#/operations/get-track]
Ok, I had a close lock at this and it seems that Spotify does sometimes provide if a property is required or optional. But they do not provide the list of required properties for all objects. For example, the SimplifiedAlbumObject
or AlbumBase
object (where your screenshot is actually from) has a list of required properties, but the TrackObject
does not have it.
Now I am considering adding the list of required properties where it is missing. So stay tuned for the next release.
This is what I have so far:
--- build/spotify-web-api-original.yaml
+++ build/spotify-web-api-fixed.yaml
@@ -4785,6 +4785,14 @@
PrivateUserObject:
type: object
x-spotify-docs-type: PrivateUserObject
+ required:
+ - display_name
+ - external_urls
+ - followers
+ - href
+ - id
+ - type
+ - uri
properties:
country:
type: string
@@ -5609,6 +5617,8 @@
allOf:
- $ref: '#/components/schemas/PagingObject'
- type: object
+ required:
+ - items
properties:
items:
type: array
@@ -6022,6 +6032,19 @@
SimplifiedPlaylistObject:
type: object
x-spotify-docs-type: SimplifiedPlaylistObject
+ required:
+ - id
+ - name
+ - description
+ - collaborative
+ - href
+ - images
+ - owner
+ - public
+ - snapshot_id
+ - tracks
+ - type
+ - uri
properties:
collaborative:
type: boolean
Update:
--- build/spotify-web-api-original.yaml
+++ build/spotify-web-api-fixed.yaml
@@ -4451,6 +4451,8 @@
ArtistObject:
type: object
x-spotify-docs-type: ArtistObject
+ required:
+ - name
properties:
external_urls:
allOf:
@@ -4506,6 +4508,8 @@
SimplifiedArtistObject:
type: object
x-spotify-docs-type: SimplifiedArtistObject
+ required:
+ - name
properties:
external_urls:
allOf:
@@ -4554,6 +4558,8 @@
PlaylistTrackObject:
type: object
x-spotify-docs-type: PlaylistTrackObject
+ required:
+ - track
properties:
added_at:
type: string
@@ -4785,6 +4791,14 @@
PrivateUserObject:
type: object
x-spotify-docs-type: PrivateUserObject
+ required:
+ - display_name
+ - external_urls
+ - followers
+ - href
+ - id
+ - type
+ - uri
properties:
country:
type: string
@@ -5609,6 +5623,8 @@
allOf:
- $ref: '#/components/schemas/PagingObject'
- type: object
+ required:
+ - items
properties:
items:
type: array
@@ -5683,6 +5699,8 @@
allOf:
- $ref: '#/components/schemas/PagingObject'
- type: object
+ required:
+ - items
properties:
items:
type: array
@@ -6022,6 +6040,19 @@
SimplifiedPlaylistObject:
type: object
x-spotify-docs-type: SimplifiedPlaylistObject
+ required:
+ - id
+ - name
+ - description
+ - collaborative
+ - href
+ - images
+ - owner
+ - public
+ - snapshot_id
+ - tracks
+ - type
+ - uri
properties:
collaborative:
type: boolean
@@ -6166,10 +6197,13 @@
TrackObject:
type: object
x-spotify-docs-type: TrackObject
+ required:
+ - name
properties:
album:
- allOf:
+ oneOf:
- $ref: '#/components/schemas/SimplifiedAlbumObject'
+ - $ref: '#/components/schemas/LocalFileNoAlbumObject'
description: |
The album on which the track appears. The album object includes a link in `href` to full information about the album.
artists:
@@ -6792,6 +6826,19 @@
$ref: '#/components/schemas/SimplifiedArtistObject'
description: |
The artists of the album. Each artist object includes a link in `href` to more detailed information about the artist.
+ LocalFileNoAlbumObject:
+ type: object
+ required:
+ - type
+ properties:
+ type:
+ type: string
+ artists:
+ type: array
+ items:
+ $ref: '#/components/schemas/SimplifiedArtistObject'
+ description: |
+ The artists of the album. Each artist object includes a link in `href` to more detailed information about the artist.
ChapterObject:
x-spotify-docs-type: ChapterObject
type: object
I've added a type for albums for local files, which don't respect the normal required
of albums
@miniBill Thanks for your work 👍
But I won't have time in the near future to review and integrate your changes, because Spotify has reworked its Spotify for Developer website. Please see #242 for more details. I will leave this issue open and when I have finished migrating to the new website I will revisit our proposals.
No worries, I'm already incredibly grateful for all your work
Hi! Any updates on this? :)
I think that
TrackObject.restrictions
should be marked as optional, but I'm still learning the OpenAPI spec, so I may be wrong.Example of a request/response pair missing the field: