-
-
Notifications
You must be signed in to change notification settings - Fork 420
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
When there are one letter parameters in URL path they generate as unused parameters in schema. They are wrongly escaped in the path: property.
Example openapi.json:
{
"openapi": "3.1.0",
"paths": {
"/some-endpoint/{a}/{ab}": {
"get": {
"parameters": [
{
"name": "a",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
},
{
"name": "ab",
"in": "path",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Successful Response",
"content": { "application/json": { "schema": {} } }
}
}
}
}
}
}
expected result:
export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
someEndpoint = {
/**
* No description
*
* @name SomeEndpointDetail
* @request GET:/some-endpoint/{a}/{ab}
*/
someEndpointDetail: (a: number, ab: number, params: RequestParams = {}) =>
this.request<any, any>({
path: `/some-endpoint/${a}/${ab}`,
method: "GET",
format: "json",
...params,
}),
};
}
result:
export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
someEndpoint = {
/**
* No description
*
* @name SomeEndpointDetail
* @request GET:/some-endpoint/{a}/{ab}
*/
someEndpointDetail: (a: number, ab: number, params: RequestParams = {}) =>
this.request<any, any>({
path: `/some-endpoint/{a}/${ab}`,
method: "GET",
format: "json",
...params,
}),
};
}
a: numberis unused parameter
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working