You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The specification keywords for routes are currently hardcoded to only generate name, in, schema, required, description as is dictated here, specifically this block of code:
params.append(
{
"name": name,
"in": "query",
"schema": schema,
"required": name in query.get("required", []),
"description": schema.get("description", ""),
}
)
However there are other keywords that might want to be added for different routes and models. For example the style and explode keywords as explained here. It would be beneficial to have some way for this to be passed in on a model-by-model basis for different routes. Something akin to the following:
params.append(
{
"name": name,
"in": "query",
"schema": schema,
"required": name in query.get("required", []),
"description": schema.get("description", ""),
**extra_spec_kwargs
}
)
Although I'm not sure what the best way to provide extra_spec_kwargs would be with the current API.
The text was updated successfully, but these errors were encountered:
jonathanlintott
changed the title
[Feature] Allow for extra keywords in route parameter specifications
[Feature] Allow for extra keywords in a routes' parameter specifications
Mar 3, 2021
Such that the parse_params function would change to do something like:
extra = {label: schema.pop(label) for label in ("explode", "style", "allowReserved") if label in schema}
params.append(
{
"name": name,
"in": "query",
"schema": schema,
"required": name in query.get("required", []),
"description": schema.get("description", ""),
**extra
}
)
The specification keywords for routes are currently hardcoded to only generate
name
,in
,schema
,required
,description
as is dictated here, specifically this block of code:However there are other keywords that might want to be added for different routes and models. For example the
style
andexplode
keywords as explained here. It would be beneficial to have some way for this to be passed in on a model-by-model basis for different routes. Something akin to the following:Although I'm not sure what the best way to provide
extra_spec_kwargs
would be with the current API.The text was updated successfully, but these errors were encountered: