Skip to content

Add Update Own Inventory Item, fix Get Inventory parameters #475

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
36 changes: 33 additions & 3 deletions openapi/components/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -510,22 +510,52 @@ inventoryTemplateId:
example: invt_00000000-0000-0000-0000-000000000000
description: Must be a valid inventory template ID.
inventorySortOrder:
name: inventorySortOrder
name: order
in: query
required: false
schema:
type: string
enum:
- newest
- newest_created
- oldest
- oldest_created
description: Sort order for inventory retrieval.
inventoryItemType:
name: inventoryItemType
inventoryItemTypes:
name: types
in: query
required: false
schema:
$ref: ./schemas/InventoryItemType.yaml
description: Filter for inventory retrieval.
inventoryItemTags:
name: tags
in: query
required: false
schema:
$ref: ./schemas/Tag.yaml
description: Filter tags for inventory retrieval (comma-separated).
inventoryItemFlags:
name: flags
in: query
required: false
schema:
$ref: ./schemas/InventoryFlag.yaml
description: Filter flags for inventory retrieval (comma-separated).
inventoryItemNotFlags:
name: notFlags
in: query
required: false
schema:
$ref: ./schemas/InventoryFlag.yaml
description: Filter out flags for inventory retrieval (comma-separated).
inventoryItemArchived:
name: archived
in: query
required: false
schema:
type: boolean
description: Filter archived status for inventory retrieval.
inventorySpawnItemId:
name: id
in: query
Expand Down
23 changes: 22 additions & 1 deletion openapi/components/paths/inventory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ paths:
- $ref: ../parameters.yaml#/number
- $ref: ../parameters.yaml#/offset
- $ref: ../parameters.yaml#/inventorySortOrder
- $ref: ../parameters.yaml#/inventoryItemType
- $ref: ../parameters.yaml#/inventoryItemTypes
- $ref: ../parameters.yaml#/inventoryItemFlags
- $ref: ../parameters.yaml#/inventoryItemNotFlags
- $ref: ../parameters.yaml#/inventoryItemArchived
get:
summary: Get Inventory
operationId: getInventory
Expand Down Expand Up @@ -39,6 +42,24 @@ paths:
tags:
- inventory
description: Returns an InventoryItem object held by the currently logged in user.
put:
summary: Update Own Inventory Item
operationId: updateOwnInventoryItem
security:
- authCookie: []
responses:
'200':
$ref: ../responses/inventory/InventoryItemResponse.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
tags:
- inventory
requestBody:
content:
application/json:
schema:
$ref: ../requests/UpdateInventoryItemRequest.yaml
description: Returns the modified InventoryItem object as held by the currently logged in user.
'/users/{userId}/inventory/{inventoryItemId}':
parameters:
- $ref: ../parameters.yaml#/userId
Expand Down
5 changes: 5 additions & 0 deletions openapi/components/requests/UpdateInventoryItemRequest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
title: UpdateInventoryItemRequest
type: object
properties:
isArchived:
type: boolean