We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
WorkSearchScheme
AllAllowedParams
1 parent d774d7e commit 9ee557eCopy full SHA for 9ee557e
openlibrary/fastapi/search.py
@@ -41,16 +41,17 @@ def pagination(
41
42
43
field_names = set(WorkSearchScheme.all_fields) | set(
44
- # WorkSearchScheme.field_name_map.keys()
45
- # Temporarily commented out because field names can't start with underscores but we have _ia_collection
+ WorkSearchScheme.field_name_map.keys()
46
)
47
48
-
49
# Dynamically create the model
50
AllAllowedParams = create_model(
51
'AllAllowedParams',
52
__base__=BaseModel,
53
- **{name: (str | None, Query(None)) for name in field_names},
+ **{
+ field.removeprefix('_'): (str | None, Query(None, alias=field))
+ for field in field_names
54
+ },
55
56
57
0 commit comments