Commit 1ab73704 authored by m-idler's avatar m-idler
Browse files

#1171 fix validity issues in openapi/swagger spec files

parent 08f54b1f
Pipeline #20477 failed with stage
in 9 seconds
...@@ -118,9 +118,14 @@ Actor: ...@@ -118,9 +118,14 @@ Actor:
BaseArtist: BaseArtist:
type: "object" type: "object"
required:
- id
- fid
- name
- creation_date
- is_local
properties: properties:
mbid: mbid:
required: false
$ref: "./properties.yml#/mbid" $ref: "./properties.yml#/mbid"
id: id:
type: "integer" type: "integer"
...@@ -157,9 +162,16 @@ Artist: ...@@ -157,9 +162,16 @@ Artist:
BaseAlbum: BaseAlbum:
type: "object" type: "object"
required:
- id
- fid
- artist
- title
- creation_date
- is_playable
- is_local
properties: properties:
mbid: mbid:
required: false
$ref: "./properties.yml#/mbid" $ref: "./properties.yml#/mbid"
id: id:
type: "integer" type: "integer"
...@@ -181,7 +193,6 @@ BaseAlbum: ...@@ -181,7 +193,6 @@ BaseAlbum:
format: "date-time" format: "date-time"
release_date: release_date:
type: "string" type: "string"
required: false
format: "date" format: "date"
example: "2001-01-01" example: "2001-01-01"
is_playable: is_playable:
...@@ -258,7 +269,7 @@ ChannelCreate: ...@@ -258,7 +269,7 @@ ChannelCreate:
type: string type: string
format: uuid format: uuid
metadata: metadata:
$ref: "#ChannelMetadata" $ref: "#/ChannelMetadata"
ChannelUpdate: ChannelUpdate:
type: "object" type: "object"
properties: properties:
...@@ -399,9 +410,18 @@ License: ...@@ -399,9 +410,18 @@ License:
BaseTrack: BaseTrack:
type: "object" type: "object"
required:
- id
- fid
- artist
- album
- title
- listen_url
- copyright
- license
- is_local
properties: properties:
mbid: mbid:
required: false
$ref: "./properties.yml#/mbid" $ref: "./properties.yml#/mbid"
id: id:
type: "integer" type: "integer"
...@@ -423,13 +443,11 @@ BaseTrack: ...@@ -423,13 +443,11 @@ BaseTrack:
type: "string" type: "string"
example: "Chop Suey!" example: "Chop Suey!"
position: position:
required: false
description: "Position of the track in the album" description: "Position of the track in the album"
type: "number" type: "number"
minimum: 1 minimum: 1
example: 1 example: 1
disc_number: disc_number:
required: false
type: "number" type: "number"
minimum: 1 minimum: 1
example: 1 example: 1
...@@ -547,12 +565,14 @@ Upload: ...@@ -547,12 +565,14 @@ Upload:
OwnedLibraryCreate: OwnedLibraryCreate:
type: "object" type: "object"
required:
- name
- privacy_level
properties: properties:
name: name:
type: "string" type: "string"
example: "My new library" example: "My new library"
description: description:
required: false
type: "string" type: "string"
example: "Lots of interesting content" example: "Lots of interesting content"
privacy_level: privacy_level:
...@@ -668,28 +688,26 @@ PlaylistTrack: ...@@ -668,28 +688,26 @@ PlaylistTrack:
ImportMetadata: ImportMetadata:
type: "object" type: "object"
required:
- title
- position
description: "Import metadata to override values from ID3/embedded audio tags" description: "Import metadata to override values from ID3/embedded audio tags"
properties: properties:
title: title:
type: "string" type: "string"
example: "My Track" example: "My Track"
required: true
mbid: mbid:
$ref: "./properties.yml#/mbid" $ref: "./properties.yml#/mbid"
required: false
copyright: copyright:
type: "string" type: "string"
example: "Alice, 2018" example: "Alice, 2018"
description: "Copyright information" description: "Copyright information"
required: false
license: license:
type: "string" type: "string"
example: "cc-by-sa-4.0" example: "cc-by-sa-4.0"
required: false
description: A license code, as returned by /api/v1/licenses description: A license code, as returned by /api/v1/licenses
tags: tags:
$ref: "./properties.yml#/tags" $ref: "./properties.yml#/tags"
required: false
position: position:
description: "Position of the track in the album or channel" description: "Position of the track in the album or channel"
type: "number" type: "number"
......
ChannelOrdering: ChannelOrdering:
- $ref: "#/Ordering" $ref: "#/Ordering"
- default: "-creation_date" required: false
schema: schema:
required: false type: "string"
type: "string" default: "creation_date"
example: "-creation_date" example: "creation_date"
enum: enum:
- creation_date - creation_date
- artist__modification_date - artist__modification_date
PlaylistOrdering:
$ref: "#/Ordering"
required: false
schema:
type: "string"
default: "creation_date"
example: "creation_date"
enum:
- creation_date
- modification_date
- id
- name
ArtistOrdering:
$ref: "#/Ordering"
required: false
schema:
type: "string"
default: "creation_date"
example: "creation_date"
enum:
- creation_date
- id
- name
- random
AlbumOrdering:
$ref: "#/Ordering"
required: false
schema:
type: "string"
default: "creation_date"
example: "creation_date"
enum:
- creation_date
- release_date
- title
- random
TrackOrdering:
$ref: "#/Ordering"
required: false
schema:
type: "string"
default: "creation_date"
example: "creation_date"
enum:
- creation_date
- release_date
- title
- random
External: External:
name: "external" name: "external"
in: "query" in: "query"
default: null required: false
description: "Filter/exclude channels created from a third-party, non-Funkwhale RSS feed" description: "Filter/exclude channels created from a third-party, non-Funkwhale RSS feed"
schema: schema:
required: false default: null
type: "boolean" type: "boolean"
...@@ -62,26 +114,26 @@ PageSize: ...@@ -62,26 +114,26 @@ PageSize:
Playable: Playable:
name: "playable" name: "playable"
in: "query" in: "query"
default: null required: false
description: "Filter/exclude resources with playable tracks" description: "Filter/exclude resources with playable tracks"
schema: schema:
required: false default: null
type: "boolean" type: "boolean"
HasAlbums: HasAlbums:
name: "has_albums" name: "has_albums"
in: "query" in: "query"
default: null required: false
description: "Filter/exclude artists with no associated albums" description: "Filter/exclude artists with no associated albums"
schema: schema:
required: false default: null
type: "boolean" type: "boolean"
Refresh: Refresh:
name: "refresh" name: "refresh"
in: "query" in: "query"
default: false required: false
description: "Trigger an ActivityPub fetch to refresh local data" description: "Trigger an ActivityPub fetch to refresh local data"
schema: schema:
required: false default: false
type: "boolean" type: "boolean"
...@@ -97,7 +149,7 @@ Related: ...@@ -97,7 +149,7 @@ Related:
Scope: Scope:
name: "scope" name: "scope"
in: "query" in: "query"
default: "all" required: false
description: | description: |
Limit the results to a given user or pod: Limit the results to a given user or pod:
- Use `all` (or do not specify the property to disable scope filtering) - Use `all` (or do not specify the property to disable scope filtering)
...@@ -109,7 +161,7 @@ Scope: ...@@ -109,7 +161,7 @@ Scope:
You can specify multiple coma separated scopes, e.g `scope=me,subscribed` to retrieve content matching either scopes. You can specify multiple coma separated scopes, e.g `scope=me,subscribed` to retrieve content matching either scopes.
schema: schema:
required: false default: "all"
type: "string" type: "string"
enum: enum:
- "me" - "me"
...@@ -124,8 +176,8 @@ ContentCategory: ...@@ -124,8 +176,8 @@ ContentCategory:
description: | description: |
Limits the results to those whose artist content type matches the query. Limits the results to those whose artist content type matches the query.
required: false
schema: schema:
required: false
type: "string" type: "string"
enum: enum:
- "podcast" - "podcast"
...@@ -134,10 +186,10 @@ ContentCategory: ...@@ -134,10 +186,10 @@ ContentCategory:
Search: Search:
name: "q" name: "q"
in: "query" in: "query"
default: "all" required: false
description: "Limit the results to the corresponding search query" description: "Limit the results to the corresponding search query"
schema: schema:
required: false default: "all"
type: "string" type: "string"
example: "Bonobo" example: "Bonobo"
...@@ -145,18 +197,19 @@ Subscribed: ...@@ -145,18 +197,19 @@ Subscribed:
name: "subscribed" name: "subscribed"
in: "query" in: "query"
description: "Limit or exclude results with a matching subsription from the current user" description: "Limit or exclude results with a matching subsription from the current user"
required: false
schema: schema:
required: false
type: boolean type: boolean
Tags: Tags:
name: "tag" name: "tag"
in: "query" in: "query"
description: "Limit the results to the corresponding tags. May be used multiple times, to retrieve objects matching al provided tags" description: "Limit the results to the corresponding tags. May be used multiple times, to retrieve objects matching al provided tags"
required: false
schema: schema:
required: false
type: array type: array
collectionFormat: csv items:
type: string
example: example:
- rock - rock
- metal - metal
\ No newline at end of file
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment