diff --git a/api/boxes.yaml b/api/boxes.yaml index 3b1973c10c994d22d4a5c4ee2d808bbc5a55fe38..20b187e2f563beae4c8d4f86a0a95e010f787df1 100644 --- a/api/boxes.yaml +++ b/api/boxes.yaml @@ -15,17 +15,139 @@ servers: - url: https://localhost:8080/ paths: + /location/{lid}: + get: + summary: Location + description: Get a location. + operationId: GetLocation + parameters: + - $ref: '#/components/parameters/LID' + responses: + '200': + $ref: '#/components/responses/Location' + '403': + $ref: '#/components/responses/Error' + post: + summary: Location + description: Create a location. + operationId: CreateLocation + parameters: + - $ref: '#/components/parameters/LID' + requestBody: + description: New location. + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Location" + responses: + '200': + $ref: '#/components/responses/Location' + '403': + $ref: '#/components/responses/Error' + patch: + summary: Location + description: Update a location. + operationId: UpdateLocation + parameters: + - $ref: '#/components/parameters/LID' + requestBody: + description: Updated location. + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Location" + responses: + '200': + $ref: '#/components/responses/Location' + '403': + $ref: '#/components/responses/Error' + delete: + summary: Location + description: Delete a location. + operationId: DeleteLocation + parameters: + - $ref: '#/components/parameters/LID' + responses: + '200': + $ref: '#/components/responses/Location' + '403': + $ref: '#/components/responses/Error' + /locations: get: summary: Locations description: Get a list of locations. operationId: GetLocations + parameters: + - $ref: '#/components/parameters/FilterQ' responses: '200': $ref: '#/components/responses/Locations' '403': $ref: '#/components/responses/Error' + /box/{bid}: + get: + summary: Box + description: Get a box. + operationId: GetBox + parameters: + - $ref: '#/components/parameters/BID' + responses: + '200': + $ref: '#/components/responses/Box' + '403': + $ref: '#/components/responses/Error' + post: + summary: Box + description: Create a box. + operationId: CreateBox + parameters: + - $ref: '#/components/parameters/BID' + requestBody: + description: New box. + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Box" + responses: + '200': + $ref: '#/components/responses/Box' + '403': + $ref: '#/components/responses/Error' + patch: + summary: Box + description: Update a box. + operationId: UpdateBox + parameters: + - $ref: '#/components/parameters/BID' + requestBody: + description: Updated box. + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Box" + responses: + '200': + $ref: '#/components/responses/Box' + '403': + $ref: '#/components/responses/Error' + delete: + summary: Box + description: Delete a box. + operationId: DeleteBox + parameters: + - $ref: '#/components/parameters/BID' + responses: + '200': + $ref: '#/components/responses/Box' + '403': + $ref: '#/components/responses/Error' + /boxes: get: summary: Boxes @@ -33,12 +155,73 @@ paths: operationId: GetBoxes parameters: - $ref: '#/components/parameters/LocationID' + - $ref: '#/components/parameters/FilterQ' responses: '200': $ref: '#/components/responses/Boxes' '403': $ref: '#/components/responses/Error' + /content/{bid}: + get: + summary: Content + description: Get a content. + operationId: GetContent + parameters: + - $ref: '#/components/parameters/BID' + responses: + '200': + $ref: '#/components/responses/Content' + '403': + $ref: '#/components/responses/Error' + post: + summary: Content + description: Create a content. + operationId: CreateContent + parameters: + - $ref: '#/components/parameters/BID' + requestBody: + description: New content. + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Content" + responses: + '200': + $ref: '#/components/responses/Content' + '403': + $ref: '#/components/responses/Error' + patch: + summary: Content + description: Update a content. + operationId: UpdateContent + parameters: + - $ref: '#/components/parameters/BID' + requestBody: + description: Updated content. + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/Content" + responses: + '200': + $ref: '#/components/responses/Content' + '403': + $ref: '#/components/responses/Error' + delete: + summary: Content + description: Delete content. + operationId: DeleteContent + parameters: + - $ref: '#/components/parameters/BID' + responses: + '200': + $ref: '#/components/responses/Content' + '403': + $ref: '#/components/responses/Error' + /contents: get: summary: Contents @@ -47,6 +230,8 @@ paths: parameters: - $ref: '#/components/parameters/LocationID' - $ref: '#/components/parameters/BoxID' + - $ref: '#/components/parameters/FilterQ' + - $ref: '#/components/parameters/TagsQ' responses: '200': $ref: '#/components/responses/Contents' @@ -56,6 +241,20 @@ paths: components: parameters: + CID: + name: cid + in: path + description: The content ID being queried. + schema: + type: string + + BID: + name: bid + in: path + description: The box ID being queried. + schema: + type: string + BoxID: name: box in: query @@ -63,6 +262,13 @@ components: schema: type: string + LID: + name: lid + in: path + description: The location ID being queried. + schema: + type: string + LocationID: name: location in: query @@ -70,7 +276,32 @@ components: schema: type: string + FilterQ: + name: filter + in: query + description: A filter to search the description. + schema: + type: string + + TagsQ: + name: tags + in: query + description: A filter to search the description. + style: form + explode: false + schema: + type: array + items: + type: string + responses: + Content: + description: Content. + content: + application/json: + schema: + $ref: '#/components/schemas/Content' + Contents: description: List of contents. content: @@ -80,6 +311,13 @@ components: items: $ref: '#/components/schemas/Content' + Box: + description: A box. + content: + application/json: + schema: + $ref: '#/components/schemas/Box' + Boxes: description: List of boxes. content: @@ -89,6 +327,13 @@ components: items: $ref: '#/components/schemas/Box' + Location: + description: A location. + content: + application/json: + schema: + $ref: '#/components/schemas/Location' + Locations: description: List of locations. content: @@ -122,6 +367,10 @@ components: type: string description: type: string + tags: + type: array + items: + type: string Box: type: object