MCPcopy
hub / github.com/lukeautry/tsoa / buildPaths

Method buildPaths

packages/cli/src/swagger/specGenerator3.ts:238–256  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

236 }
237
238 protected buildPaths() {
239 const paths: { [pathName: string]: Swagger.Path3 } = {};
240
241 this.metadata.controllers.forEach(controller => {
242 const normalisedControllerPath = normalisePath(controller.path, '/');
243 // construct documentation using all methods except @Hidden
244 controller.methods
245 .filter(method => !method.isHidden)
246 .forEach(method => {
247 const normalisedMethodPath = normalisePath(method.path, '/');
248 let path = normalisePath(`${normalisedControllerPath}${normalisedMethodPath}`, '/', '', false);
249 path = convertColonPathParams(path);
250 paths[path] = paths[path] || {};
251 this.buildMethod(controller.name, method, paths[path], controller.produces);
252 });
253 });
254
255 return paths;
256 }
257
258 protected buildMethod(controllerName: string, method: Tsoa.Method, pathObject: any, defaultProduces?: string[]) {
259 const pathMethod: Swagger.Operation3 = (pathObject[method.method] = this.buildOperation(controllerName, method, defaultProduces));

Callers 2

GetSpecMethod · 0.95
GetSpecMethod · 0.45

Calls 3

buildMethodMethod · 0.95
normalisePathFunction · 0.90
convertColonPathParamsFunction · 0.90

Tested by

no test coverage detected