Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial OpenAPI spec - Collection endpoints #2671

Closed
wants to merge 34 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4c11ca5
Added `swagger-jsdoc`
nichwall Feb 16, 2024
f41b1b6
Initial CollectionController OpenAPI spec
nichwall Feb 17, 2024
5a248e6
Updated OpenAPI to 3.1.0
nichwall Feb 17, 2024
223e156
Initial Python API tester
nichwall Feb 17, 2024
bb297a3
Updated null types in initial OpenAPI spec
nichwall Feb 19, 2024
9bb264a
Current version of generated API-spec
nichwall Feb 19, 2024
4fff661
Cleaned up libraryId schema definition
nichwall Feb 19, 2024
fe33b4c
Cleaned up `mediaType` schema
nichwall Feb 19, 2024
0aba5e6
Cleaned up `createdAt` schema
nichwall Feb 19, 2024
f5e1e5f
Added tags and other cleanup
nichwall Feb 20, 2024
4e9151e
Cleaned up component examples
nichwall Feb 20, 2024
0d89076
Updated `swagger_output.json` file
nichwall Feb 20, 2024
a90e796
Created `collectionBase` schema
nichwall Feb 20, 2024
6321c76
Fixed linting warnings for paths
nichwall Feb 20, 2024
933c4f2
Finishing initial `CollectionController` endpoints
nichwall Feb 25, 2024
f4fbb22
Preventing validation errors with `wiretap`
nichwall Feb 25, 2024
cc37c3d
`LibraryController` collections updates
nichwall Feb 25, 2024
cc53f16
Moved schemas into `objects/` definitions
nichwall Feb 25, 2024
c89bd1b
Moved `Collection` schema to `objects/`
nichwall Feb 25, 2024
c9832ca
Generic `libraryId`
nichwall Feb 25, 2024
6525cca
Fix: response for library collections
nichwall Feb 25, 2024
c7ca8b7
Committing new spec
nichwall Feb 25, 2024
8558631
Cleaning up LibraryItem schemas
nichwall Feb 25, 2024
0ffc6fb
Fixing LibraryItem polymorphism
nichwall Feb 25, 2024
211b422
Cleaned up `libraryItemId`
nichwall Feb 27, 2024
0b95c85
PodcastBase schema update
nichwall Feb 27, 2024
0e72dc5
Updated spec
nichwall Feb 27, 2024
1840e8a
Updated `api_running` to current version
nichwall Feb 27, 2024
cc4bc4c
Updated `package-lock` for `swagger-jsdoc`
nichwall Feb 28, 2024
ad52868
Cleaned up `BookMetadata` schema
nichwall Mar 1, 2024
f432004
Podcast schemas cleanup
nichwall Mar 1, 2024
1c57981
Cleaned up `addedAt` and `updatedAt`
nichwall Mar 1, 2024
02a4014
`PlaybackSession` schema cleanup
nichwall Mar 1, 2024
dba8723
Fix: `addedAt` schema
nichwall Mar 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Created collectionBase schema
nichwall committed Feb 20, 2024
commit a90e79657b046f1013ebf6c6b253100a9b9afc67
78 changes: 32 additions & 46 deletions build-docs/swagger-output.json
Original file line number Diff line number Diff line change
@@ -331,9 +331,9 @@
},
"components": {
"schemas": {
"collection": {
"collectionBase": {
"type": "object",
"description": "A public collection of library items which can be ordered and has a description.",
"description": "A public collection of library items which can be ordered and has a description, base schema.",
"properties": {
"id": {
"description": "The ID of the collection.",
@@ -354,13 +354,6 @@
null
]
},
"books": {
"description": "The books that belong to the collection.",
"type": "array",
"items": {
"$ref": "#/components/schemas/libraryItem"
}
},
"lastUpdate": {
"description": "The time (in ms since POSIX epoch) when the collection was last updated.",
"type": "integer"
@@ -371,48 +364,41 @@
}
}
},
"collectionExpanded": {
"collection": {
"type": "object",
"properties": {
"id": {
"description": "The ID of the collection.",
"type": "string"
},
"libraryId": {
"description": "The ID of the library the collection belongs to.",
"type": "string"
},
"userId": {
"description": "The ID of the user that created the collection.",
"type": "string"
},
"name": {
"description": "The name of the collection.",
"type": "string"
},
"description": {
"description": "The name of the collection.",
"type": [
"string",
"null"
]
"description": "A public collection of library items which can be ordered and has a description.",
"allOf": [
{
"$ref": "#/components/schemas/collectionBase"
},
"books": {
"description": "The books that belong to the collection.",
"type": "array",
"items": {
"$ref": "#/components/schemas/libraryItemExpanded"
{
"books": {
"description": "The books that belong to the collection.",
"type": "array",
"items": {
"$ref": "#/components/schemas/libraryItem"
}
}
}
]
},
"collectionExpanded": {
"type": "object",
"description": "A public collection of library items which can be ordered and has a description. Replaces `libraryItem` with `libraryItemExtended`.",
"allOf": [
{
"$ref": "#/components/schemas/collectionBase"
},
"lastUpdate": {
"description": "The time (in ms since POSIX epoch) when the collection was last updated.",
"type": "integer"
},
"createdAt": {
"description": "The time (in ms since POSIX epoch) when the collection was created.",
"type": "integer"
{
"books": {
"description": "The books that belong to the collection.",
"type": "array",
"items": {
"$ref": "#/components/schemas/libraryItemExpanded"
}
}
}
}
]
},
"oldLibraryId": {
"type": "string",
54 changes: 20 additions & 34 deletions server/models/Collection.js
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@ const oldCollection = require('../objects/Collection')
* @openapi
* components:
* schemas:
* collection:
* collectionBase:
* type: object
* description: A public collection of library items which can be ordered and has a description.
* description: A public collection of library items which can be ordered and has a description, base schema.
* properties:
* id:
* description: The ID of the collection.
@@ -22,46 +22,32 @@ const oldCollection = require('../objects/Collection')
* description:
* description: The description of the collection.
* type: [string, null]
* books:
* description: The books that belong to the collection.
* type: array
* items:
* $ref: '#/components/schemas/libraryItem'
* lastUpdate:
* description: The time (in ms since POSIX epoch) when the collection was last updated.
* type: integer
* createdAt:
* description: The time (in ms since POSIX epoch) when the collection was created.
* type: integer
* collection:
* type: object
* description: A public collection of library items which can be ordered and has a description.
* allOf:
* - $ref: '#/components/schemas/collectionBase'
* - books:
* description: The books that belong to the collection.
* type: array
* items:
* $ref: '#/components/schemas/libraryItem'
* collectionExpanded:
* type: object
* properties:
* id:
* description: The ID of the collection.
* type: string
* libraryId:
* description: The ID of the library the collection belongs to.
* type: string
* userId:
* description: The ID of the user that created the collection.
* type: string
* name:
* description: The name of the collection.
* type: string
* description:
* description: The name of the collection.
* type: [string, 'null']
* books:
* description: The books that belong to the collection.
* type: array
* items:
* $ref: '#/components/schemas/libraryItemExpanded'
* lastUpdate:
* description: The time (in ms since POSIX epoch) when the collection was last updated.
* type: integer
* createdAt:
* description: The time (in ms since POSIX epoch) when the collection was created.
* type: integer
* description: A public collection of library items which can be ordered and has a description. Replaces `libraryItem` with `libraryItemExtended`.
* allOf:
* - $ref: '#/components/schemas/collectionBase'
* - books:
* description: The books that belong to the collection.
* type: array
* items:
* $ref: '#/components/schemas/libraryItemExpanded'
*/
class Collection extends Model {
constructor(values, options) {