Open mahenzon opened 8 months ago
можно взять как отправную точку вот такую переделку. Но надо ещё списки обрабатывать
fields = {
schema_field.name: (schema_field.outer_type_, schema_field.field_info),
}
class Config:
arbitrary_types_allowed = True
# Create the model using create_model
ValidationModel = pydantic.create_model(
"ValidationModel",
**fields,
__config__=Config,
)
validated = ValidationModel.parse_obj({schema_field.name: value})
val = getattr(validated, schema_field.name)
return getattr(model_column, operator)(val)
0: error processing invalid filters (
value
instead ofval
)You'll get an error here:
https://github.com/mts-ai/FastAPI-JSONAPI/blob/3e68db50e8288ca9019846e830b7b647478d511b/fastapi_jsonapi/data_layers/filtering/sqlalchemy.py#L254
1: error processing json
Try creating a filter like this:
The problem is here: https://github.com/mts-ai/FastAPI-JSONAPI/blob/3e68db50e8288ca9019846e830b7b647478d511b/fastapi_jsonapi/data_layers/filtering/sqlalchemy.py#L199-L201