Skip to content

Commit

Permalink
fix the last lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Dec 2, 2023
1 parent 1716f6f commit 71d9a50
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions generator/client/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,15 @@ export function docComment(

type PathConfig = ReturnType<typeof iterPathConfig>[number];
export function iterPathConfig(paths: OpenAPIV3.Document["paths"]) {
return Object.entries(paths)
.flatMap(([path, handlers]) => {
return Object.values(HttpMethods).map((method) => {
const conf = handlers![method]!;
return Object.entries(paths).flatMap(([path, handlers]) => {
if (!handlers) return [];

return {
path,
conf,
method,
opId: conf?.operationId!,
};
});
})
.filter(({ conf }) => conf && conf.operationId);
return Object.values(HttpMethods).flatMap((method) => {
const conf = handlers[method];
if (!conf || !conf.operationId) return [];
return { path, conf, method, opId: conf.operationId };
});
});
}

type Param = Omit<OpenAPIV3.ParameterObject, "schema"> &
Expand Down

0 comments on commit 71d9a50

Please sign in to comment.