Comparing version 0.16.0 to 0.16.1
12
index.js
@@ -682,2 +682,12 @@ 'use strict'; | ||
} | ||
function normalizePathParamForOpenAPI(path) { | ||
const pathParts = path.split('/'); | ||
const normalizedPathParts = pathParts.map((part) => { | ||
if (part.startsWith(':')) { | ||
return `{${part.slice(1)}}`; | ||
} | ||
return part; | ||
}); | ||
return normalizedPathParts.join('/'); | ||
} | ||
@@ -916,3 +926,3 @@ function buildSchemaObjectFromType(type, opts) { | ||
const path = basePath + | ||
info.path.replace(/\:[a-z0-9]+\w/i, (param) => `{${param.replace(':', '')}}`); | ||
normalizePathParamForOpenAPI(info.path); | ||
if (!swagger.paths[path]) { | ||
@@ -919,0 +929,0 @@ swagger.paths[path] = {}; |
export declare function mapToPrimitive(type: string): any; | ||
export declare function mapToRef(type: string): string; | ||
export declare function normalizePathParamForOpenAPI(path: string): string; |
{ | ||
"name": "sofa-api", | ||
"version": "0.16.0", | ||
"version": "0.16.1", | ||
"description": "Create REST APIs with GraphQL", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
91533
2051