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.
@@ -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 = /[:|?](.*?)\//g
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.slice(1, -1),
131
- required: p[0] === ':',
130
+ name: p.replace(regex, '$1'),
131
+ required: p[p.length - 2] !== '?',
132
132
  in: 'path',
133
133
  type: 'string'
134
134
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pwi-plata-type",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "bin": {