-
-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
Which is because it provides it's attrs adding them to provided ones without using dict.
list_items = self._route_factory.list(
path="/",
schema_out=kw.pop("schema_out", self._retrieve_schema), # type:ignore[arg-type]
**kw, # type:ignore[arg-type]
**paginate_kwargs,
)
instead, why wouldn't we make it whole dict to support overwriting?
list_items = self._route_factory.list(**{
"path": "/",
"schema_out": kw.pop("schema_out", self._retrieve_schema), # type:ignore[arg-type]
**kw, # type:ignore[arg-type]
**paginate_kwargs,
})
or if you want to trigger error if pagination fields interfere with base ones, you may keep them separate.
list_items = self._route_factory.list(
**{
"path": "/",
"schema_out": kw.pop("schema_out", self._retrieve_schema), # type:ignore[arg-type]
**kw, # type:ignore[arg-type]
}
**paginate_kwargs,
)
similar applies to the other builder methods. Now to make it working you have to add an endpoint with the factory which seems as an overkill to just change a few options. I assume, making a good use of these *_route_info dicts might remove any need of using the factory for the base actions when using model_config.
Metadata
Metadata
Assignees
Labels
No labels