pwi-plata-type 0.2.14 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/plata-swagger-gen.ts +3 -3
- package/package.json +1 -1
package/bin/plata-swagger-gen.ts
CHANGED
|
@@ -108,7 +108,7 @@ function loadSwaggerFiles(): swaggerFiles {
|
|
|
108
108
|
async function dumpRotas(): Promise<dumpRoute[]> {
|
|
109
109
|
const rotas = await loadExpressRoutes()
|
|
110
110
|
const rotasMetodos: dumpRoute[] = []
|
|
111
|
-
const regex =
|
|
111
|
+
const regex = /:(.*?)\??\//g
|
|
112
112
|
for (const r of rotas) {
|
|
113
113
|
const expressRouter = await r.exports()
|
|
114
114
|
|
|
@@ -127,8 +127,8 @@ async function dumpRotas(): Promise<dumpRoute[]> {
|
|
|
127
127
|
|
|
128
128
|
for (const p of urlParms) {
|
|
129
129
|
routeParams.push({
|
|
130
|
-
name: p.
|
|
131
|
-
required: p[
|
|
130
|
+
name: p.replace(regex, '$1'),
|
|
131
|
+
required: p[p.length - 2] !== '?',
|
|
132
132
|
in: 'path',
|
|
133
133
|
type: 'string'
|
|
134
134
|
})
|