Skip to content

Commit 8a84abe

Browse files
committed
Fix parsing of fastapi search.json boolean parsing
1 parent 6304926 commit 8a84abe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

openlibrary/fastapi/search.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
import json
4-
from typing import Annotated, Any
4+
from typing import Annotated, Any, Literal
55

66
from fastapi import APIRouter, Depends, Query, Request
77
from fastapi.responses import JSONResponse
@@ -50,8 +50,8 @@ class PublicQueryOptions(BaseModel):
5050
person: str | None = None
5151
time: str | None = None
5252
# from workscheme facet_fields
53-
has_fulltext: bool | None = None
54-
public_scan_b: bool | None = None
53+
has_fulltext: Literal['true', 'false'] | None = None
54+
public_scan_b: Literal['true', 'false'] | None = None
5555

5656
"""
5757
The day will come when someone asks, why do we have Field wrapping Query

0 commit comments

Comments
 (0)