updated docs and routing
This commit is contained in:
@@ -29,7 +29,7 @@ fun Application.configureRouting() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
swaggerUI(path = "swagger", swaggerFile = "src/main/resources/openapi/documentation.yaml") {
|
swaggerUI(path = "swagger", swaggerFile = "src/main/resources/openapi/documentation.yaml") {
|
||||||
version = "3.1.0"
|
version="5.27.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
openapi: 3.1.0
|
openapi: 3.0.4
|
||||||
info:
|
info:
|
||||||
title: "LMS APIs"
|
title: "LMS APIs"
|
||||||
description: "Library Management System APIs"
|
description: "Public and Private Library Management System APIs"
|
||||||
version: "0.0.1"
|
version: "0.0.1"
|
||||||
servers:
|
servers:
|
||||||
- url: "http://0.0.0.0:8080"
|
- url: "http://0.0.0.0:8080"
|
||||||
paths:
|
paths:
|
||||||
|
|
||||||
/items:
|
/items:
|
||||||
get:
|
get:
|
||||||
description: "Search for item in collection"
|
description: "Search for item in collection"
|
||||||
@@ -24,16 +25,15 @@ paths:
|
|||||||
example: id=27
|
example: id=27
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: "OK"
|
description: "Depending on if an ID or title was used, single (ID) or list of (Title) CollectionItems is returned."
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/CollectionItem"
|
$ref: "./endpoints/items.yaml#/components/schemas/CollectionItem"
|
||||||
"400":
|
"400":
|
||||||
description: "Bad Request"
|
description: "Bad Request. Something was malformed or missing."
|
||||||
"404":
|
"404":
|
||||||
description: "Not Found"
|
description: "No items were found using the provided information."
|
||||||
|
|
||||||
post:
|
post:
|
||||||
description: "The method to add items to the collection."
|
description: "The method to add items to the collection."
|
||||||
requestBody:
|
requestBody:
|
||||||
@@ -42,13 +42,12 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/CollectionItem"
|
$ref: "#/components/schemas/NewCollectionItem"
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: "OK"
|
description: "A success message is returned."
|
||||||
"400":
|
"400":
|
||||||
description: "Bad Request"
|
description: "Bad Request. Either the item failed to be inserted into the database, or something was wrong in the request."
|
||||||
|
|
||||||
patch:
|
patch:
|
||||||
description: "The method to update an item."
|
description: "The method to update an item."
|
||||||
requestBody:
|
requestBody:
|
||||||
@@ -60,26 +59,39 @@ paths:
|
|||||||
$ref: "#/components/schemas/CollectionItem"
|
$ref: "#/components/schemas/CollectionItem"
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: "OK"
|
description: "A success message is returned."
|
||||||
"400":
|
"400":
|
||||||
description: "Bad Request"
|
description: "Bad Request. Either the item failed to be updated in the database, or something was wrong in the request."
|
||||||
"404":
|
"404":
|
||||||
description: "Not Found"
|
description: "No CollectionItem was found with the provided ID."
|
||||||
|
|
||||||
delete:
|
delete:
|
||||||
description: "The method to soft delete an item."
|
description: "The method to soft delete an item."
|
||||||
parameters:
|
parameters:
|
||||||
- name: "id"
|
- name: "id"
|
||||||
in: "path"
|
in: "path"
|
||||||
required: false
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
example: id=27
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: "A (sad) success message is returned."
|
||||||
|
"400":
|
||||||
|
description: "Bad Request. Either the item failed to be deleted from the database, or something was wrong in the request."
|
||||||
|
|
||||||
|
/libraries:
|
||||||
|
get:
|
||||||
|
description: ""
|
||||||
|
parameters:
|
||||||
|
- name: "id"
|
||||||
|
in: "path"
|
||||||
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
example: id=27
|
example: id=27
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: "OK"
|
description: "OK"
|
||||||
"400":
|
|
||||||
description: "Bad Request"
|
|
||||||
|
|
||||||
components:
|
components:
|
||||||
schemas:
|
schemas:
|
||||||
@@ -119,12 +131,12 @@ components:
|
|||||||
type: "integer"
|
type: "integer"
|
||||||
format: "int64"
|
format: "int64"
|
||||||
description: "The ISBN number assigned to the book. Also known as the barcode."
|
description: "The ISBN number assigned to the book. Also known as the barcode."
|
||||||
example: ""
|
example: 0
|
||||||
sortTitle:
|
sortTitle:
|
||||||
type: "string"
|
type: "string"
|
||||||
description: "The tite of the book with any articles moved to the end for sorting purposes."
|
description: "The title of the book with any articles moved to the end for sorting purposes."
|
||||||
example: "Fellowship of the Ring, The"
|
example: "Fellowship of the Ring, The"
|
||||||
format:
|
"format":
|
||||||
type: "string"
|
type: "string"
|
||||||
description: "The format the media is in. E.g. book, magazine, dvd, 8-track, etc."
|
description: "The format the media is in. E.g. book, magazine, dvd, 8-track, etc."
|
||||||
example: "book"
|
example: "book"
|
||||||
@@ -136,6 +148,7 @@ components:
|
|||||||
type: "integer"
|
type: "integer"
|
||||||
format: "int32"
|
format: "int32"
|
||||||
description: "The number of pages the media has. 0 if not a book/magazine."
|
description: "The number of pages the media has. 0 if not a book/magazine."
|
||||||
|
example: 450
|
||||||
categories:
|
categories:
|
||||||
type: "array"
|
type: "array"
|
||||||
description: "A list of the subjects/categories the media falls into."
|
description: "A list of the subjects/categories the media falls into."
|
||||||
@@ -148,7 +161,7 @@ components:
|
|||||||
type: "integer"
|
type: "integer"
|
||||||
format: "int32"
|
format: "int32"
|
||||||
description: "The cost of the item, in cents. E.g. $20 is 2000."
|
description: "The cost of the item, in cents. E.g. $20 is 2000."
|
||||||
example: ""
|
example: 4000
|
||||||
coverImageUri:
|
coverImageUri:
|
||||||
type: "string"
|
type: "string"
|
||||||
description: "The path to find the cover image for the item."
|
description: "The path to find the cover image for the item."
|
||||||
@@ -200,19 +213,19 @@ components:
|
|||||||
type: "integer"
|
type: "integer"
|
||||||
format: "int64"
|
format: "int64"
|
||||||
description: "The ISBN number assigned to the book. Also known as the barcode."
|
description: "The ISBN number assigned to the book. Also known as the barcode."
|
||||||
example: ""
|
example: 0
|
||||||
sortTitle:
|
sortTitle:
|
||||||
type: "string"
|
type: "string"
|
||||||
description: "The tite of the book with any articles moved to the end for sorting purposes."
|
description: "The title of the book with any articles moved to the end for sorting purposes."
|
||||||
example: "Fellowship of the Ring, The"
|
example: "Fellowship of the Ring, The"
|
||||||
format:
|
"format":
|
||||||
type: "string"
|
type: "string"
|
||||||
description: "The format the media is in. E.g. book, magazine, dvd, 8-track, etc."
|
description: "The format the media is in. E.g. book, magazine, dvd, 8-track, etc."
|
||||||
example: "book"
|
example: "book"
|
||||||
language:
|
language:
|
||||||
type: "string"
|
type: "string"
|
||||||
description: "The two letter abbreviation of the language the media is in."
|
description: "The two letter abbreviation of the language the media is in."
|
||||||
example: ""
|
example: "en, el"
|
||||||
pageCount:
|
pageCount:
|
||||||
type: "integer"
|
type: "integer"
|
||||||
format: "int32"
|
format: "int32"
|
||||||
@@ -224,16 +237,16 @@ components:
|
|||||||
description:
|
description:
|
||||||
type: "string"
|
type: "string"
|
||||||
description: "A short synopsis or blurb about the media."
|
description: "A short synopsis or blurb about the media."
|
||||||
example: ""
|
example: "Super cool book about elves and humans and dwarves."
|
||||||
priceInCents:
|
priceInCents:
|
||||||
type: "integer"
|
type: "integer"
|
||||||
format: "int32"
|
format: "int32"
|
||||||
description: "The cost of the item, in cents. E.g. $20 is 2000."
|
description: "The cost of the item, in cents. E.g. $20 is 2000."
|
||||||
example: ""
|
example: 4000
|
||||||
coverImageUri:
|
coverImageUri:
|
||||||
type: "string"
|
type: "string"
|
||||||
description: "The path to find the cover image for the item."
|
description: "The path to find the cover image for the item."
|
||||||
example: ""
|
example: "path/to/blob/cover.png"
|
||||||
isCheckedIn:
|
isCheckedIn:
|
||||||
type: "boolean"
|
type: "boolean"
|
||||||
description: "A flag to show if the item is checked in (true) or checked out (false)."
|
description: "A flag to show if the item is checked in (true) or checked out (false)."
|
||||||
@@ -250,3 +263,109 @@ components:
|
|||||||
type: "string"
|
type: "string"
|
||||||
description: "A string representation of the date the item is updated to lost. yyyy-MM-DD. 9999-12-31 for not lost."
|
description: "A string representation of the date the item is updated to lost. yyyy-MM-DD. 9999-12-31 for not lost."
|
||||||
example: "9999-12-31"
|
example: "9999-12-31"
|
||||||
|
|
||||||
|
Patron:
|
||||||
|
type: "object"
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: "integer"
|
||||||
|
format: "int64"
|
||||||
|
description: ""
|
||||||
|
example: 201
|
||||||
|
name:
|
||||||
|
type: "string"
|
||||||
|
description: ""
|
||||||
|
example: "Nick Kalar"
|
||||||
|
hasGoodStanding:
|
||||||
|
type: "string"
|
||||||
|
description: ""
|
||||||
|
example: true
|
||||||
|
feeTotal:
|
||||||
|
type: "integer"
|
||||||
|
format: "int64"
|
||||||
|
description: "The amount owed by the parton for late/lost books in cents"
|
||||||
|
example: 25
|
||||||
|
isArchived:
|
||||||
|
type: "boolean"
|
||||||
|
description: "A flag to denote a deleted or expired accounts. Accounts become archived if not used for a certain amount of time."
|
||||||
|
example: false
|
||||||
|
lastLogin:
|
||||||
|
type: "string"
|
||||||
|
description: "A string representation of the last time a user logged in. yyyy-MM-DD."
|
||||||
|
example: "2025-08-11"
|
||||||
|
password:
|
||||||
|
type: "string"
|
||||||
|
description: "The hashed password for the patron. This will only be stored in memory for as long as it is needed, then will be null."
|
||||||
|
example: "4bf94ee173fd60f5a2a01870390e27ae7b21acc21fe8c1ae66b3d29e4f1155d1"
|
||||||
|
NewPatron:
|
||||||
|
type: "object"
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: "string"
|
||||||
|
description: ""
|
||||||
|
example: "Nick Kalar"
|
||||||
|
hasGoodStanding:
|
||||||
|
type: "string"
|
||||||
|
description: ""
|
||||||
|
example: true
|
||||||
|
feeTotal:
|
||||||
|
type: "integer"
|
||||||
|
format: "int64"
|
||||||
|
description: "The amount owed by the parton for late/lost books in cents"
|
||||||
|
example: 25
|
||||||
|
isArchived:
|
||||||
|
type: "boolean"
|
||||||
|
description: "A flag to denote a deleted or expired accounts. Accounts become archived if not used for a certain amount of time."
|
||||||
|
example: false
|
||||||
|
lastLogin:
|
||||||
|
type: "string"
|
||||||
|
description: "A string representation of the last time a user logged in. yyyy-MM-DD."
|
||||||
|
example: "2025-08-11"
|
||||||
|
password:
|
||||||
|
type: "string"
|
||||||
|
description: "The hashed password for the patron. This will only be stored in memory for as long as it is needed, then will be null."
|
||||||
|
example: "4bf94ee173fd60f5a2a01870390e27ae7b21acc21fe8c1ae66b3d29e4f1155d1"
|
||||||
|
|
||||||
|
Staff:
|
||||||
|
type: "object"
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: "integer"
|
||||||
|
format: "int64"
|
||||||
|
description: ""
|
||||||
|
example: 201
|
||||||
|
NewStaff:
|
||||||
|
type: "object"
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: "string"
|
||||||
|
description: ""
|
||||||
|
example: "Nick Kalar"
|
||||||
|
|
||||||
|
Library:
|
||||||
|
type: "object"
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: "integer"
|
||||||
|
format: "int64"
|
||||||
|
description: ""
|
||||||
|
example: 1
|
||||||
|
name:
|
||||||
|
type: "string"
|
||||||
|
description: ""
|
||||||
|
example: "Berta Yero Fernandez Memorial Library"
|
||||||
|
address:
|
||||||
|
type: "string"
|
||||||
|
description: ""
|
||||||
|
example: "628 Arvin St. Bakersfield, Ca 93308"
|
||||||
|
NewLibrary:
|
||||||
|
type: "object"
|
||||||
|
properties:
|
||||||
|
name:
|
||||||
|
type: "string"
|
||||||
|
description: ""
|
||||||
|
example: "Berta Yero Fernandez Memorial Library"
|
||||||
|
address:
|
||||||
|
type: "string"
|
||||||
|
description: ""
|
||||||
|
example: "628 Arvin St. Bakersfield, Ca 93308"
|
||||||
|
|||||||
Reference in New Issue
Block a user