Skip to content

Commit 3f095c8

Browse files
committed
Fix resources API spec
1 parent 4fce18b commit 3f095c8

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

Tekst-API/openapi.json

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3585,12 +3585,19 @@
35853585
"in": "query",
35863586
"required": false,
35873587
"schema": {
3588-
"type": "string",
3589-
"minLength": 24,
3590-
"maxLength": 24,
3591-
"pattern": "^[0-9a-f]{24}$",
3588+
"anyOf": [
3589+
{
3590+
"type": "string",
3591+
"minLength": 24,
3592+
"maxLength": 24,
3593+
"pattern": "^[0-9a-f]{24}$",
3594+
"example": "5eb7cf5a86d9755df3a6c593"
3595+
},
3596+
{
3597+
"type": "null"
3598+
}
3599+
],
35923600
"description": "ID of text to find resources for",
3593-
"example": "5eb7cf5a86d9755df3a6c593",
35943601
"title": "Txt"
35953602
},
35963603
"description": "ID of text to find resources for"
@@ -3600,7 +3607,14 @@
36003607
"in": "query",
36013608
"required": false,
36023609
"schema": {
3603-
"type": "integer",
3610+
"anyOf": [
3611+
{
3612+
"type": "integer"
3613+
},
3614+
{
3615+
"type": "null"
3616+
}
3617+
],
36043618
"description": "Structure level to find resources for",
36053619
"title": "Lvl"
36063620
},

Tekst-API/tekst/routers/resources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,14 @@ async def update_resource(
300300
async def find_resources(
301301
user: OptionalUserDep,
302302
text_id: Annotated[
303-
PydanticObjectId,
303+
PydanticObjectId | None,
304304
Query(
305305
alias="txt",
306306
description="ID of text to find resources for",
307307
),
308308
] = None,
309309
level: Annotated[
310-
int,
310+
int | None,
311311
Query(
312312
alias="lvl",
313313
description="Structure level to find resources for",

Tekst-Web/src/api/schema.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9185,9 +9185,9 @@ export interface operations {
91859185
parameters: {
91869186
query?: {
91879187
/** @description ID of text to find resources for */
9188-
txt?: string;
9188+
txt?: string | null;
91899189
/** @description Structure level to find resources for */
9190-
lvl?: number;
9190+
lvl?: number | null;
91919191
/** @description Type of resources to find */
91929192
type?: string | null;
91939193
limit?: number;

0 commit comments

Comments
 (0)