Closed
Description
My example is Swagger 2, I'm not sure if OpenAPI 3.x specs are affected as well (I only work in Swagger still).
Path Items are able to extend the schema using ^x-
fields, docs: https://swagger.io/specification/v2/#patterned-fields-1
Example spec
"paths": {
"/foo/bar": {
"x-swagger-router-controller": "foo",
"get": { ... }
}
}
Generated Client
export class Api<SecurityDataType = any> extends HttpClient<SecurityDataType> {
example = {
/**
* @name xSwaggerRouterControllerFoo
* @request X SWAGGER ROUTER CONTROLLER:/foo/bar
*/
xSwaggerRouterControllerFoo: (params?: RequestParams) =>
this.request<any, any>(`/foo/bar`, "X SWAGGER ROUTER CONTROLLER", params),
...
Generated Namespace
/**
* @name xSwaggerRouterControllerFoo
* @request X SWAGGER ROUTER CONTROLLER:/foo/bar
*/
export namespace XSwaggerRouterControllerFoo {
export type RequestQuery = {};
export type RequestBody = never;
export type ResponseBody = any;
}
The expected behavior is that these extensions would be ignored when collating the operations.
It might be as simple as replacing this omit
with a pick
and a hard-coded list of verbs.
swagger-typescript-api/src/routes.js
Line 179 in 7a23584
But given this comment I didn't presume to open a PR myself.
swagger-typescript-api/src/routes.js
Line 177 in 7a23584