Open
Description
Is your feature request related to a problem? Please describe.
It is currently not possible to provide a type for a query parameter.
# This should be documented in the OpenAPI as an integer, but cannot express that.
limit_query_param = ns.param('limit', 'Maximum number of results to be returned.')
When client code is generated, for example for TypeScript, string
types are using instead of number
which makes the code less self-descriptive and error prone. It also requires extra type conversions, e.g. String(limit)
.
/**
*
* @param {string} [limit] Maximum number of results to be returned.
* @param {string} [xFields] An optional fields mask
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ApiApi
*/
public getTodoList(
limit?: string, # This should be integer
options?: any
Describe the solution you'd like
Be able to express the type of a query parameter and have that propagate to the OpenAPI schema.
# type defaults to string for backwards compatibilty
limit_query_param = ns.param('limit', 'Maximum number of results to be returned.', type=SchemaTypes.integer)