diff --git a/src/schema-routes/schema-routes.js b/src/schema-routes/schema-routes.js index c0dac382..2435e642 100644 --- a/src/schema-routes/schema-routes.js +++ b/src/schema-routes/schema-routes.js @@ -110,7 +110,7 @@ class SchemaRoutes { originalRouteName; const pathParamMatches = (routeName || '').match( - /({(([A-z]){1}([a-zA-Z0-9-_.]-?_?\.?)+)([0-9]+)?})|(:(([A-z]){1}([a-zA-Z0-9-_.]-?_?\.?)+)([0-9]+)?:?)/g, + /({[a-zA-Z]([a-zA-Z0-9-_.])*})|(:[a-zA-Z]([-_.]?[a-zA-Z0-9-_.])*:?)/g, ); // used in case when path parameters is not declared in requestInfo.parameters ("in": "path") diff --git a/tests/spec/extractRequestParams/expected.ts b/tests/spec/extractRequestParams/expected.ts index 58667e22..f6994d97 100644 --- a/tests/spec/extractRequestParams/expected.ts +++ b/tests/spec/extractRequestParams/expected.ts @@ -496,6 +496,27 @@ export class Api extends HttpClient + this.request< + { + /** base64safe encoded public signing key */ + sub?: string; + }, + Error + >({ + path: `/i_key/underlines/${iUk}`, + method: "GET", + format: "json", + ...params, + }), }; login = { /** diff --git a/tests/spec/extractRequestParams/schema.json b/tests/spec/extractRequestParams/schema.json index a3982337..8d4d5098 100644 --- a/tests/spec/extractRequestParams/schema.json +++ b/tests/spec/extractRequestParams/schema.json @@ -56,6 +56,13 @@ "required": true, "type": "string" }, + "i__UK": { + "description": "Variable with double __ in it.", + "in": "path", + "name": "i__UK", + "required": true, + "type": "string" + }, "i_PK": { "description": "Public Signing Key - Authentiq ID (43 chars)", "in": "path", @@ -480,6 +487,36 @@ "tags": ["key", "get"] } }, + "/i_key/underlines/{i__UK}": { + "get": { + "description": "Get public details of an Authentiq ID.\n", + "parameters": [ + { + "$ref": "#/parameters/i__UK" + } + ], + "produces": ["application/json"], + "responses": { + "200": { + "description": "Successfully retrieved", + "schema": { + "properties": { + "sub": { + "description": "base64safe encoded public signing key", + "type": "string" + } + }, + "title": "JWT", + "type": "object" + } + }, + "default": { + "$ref": "#/responses/ErrorResponse" + } + }, + "tags": ["key", "get"] + } + }, "/login": { "post": { "consumes": ["application/jwt"], diff --git a/tests/spec/extractRequestParams/schema.ts b/tests/spec/extractRequestParams/schema.ts index 58667e22..f6994d97 100644 --- a/tests/spec/extractRequestParams/schema.ts +++ b/tests/spec/extractRequestParams/schema.ts @@ -496,6 +496,27 @@ export class Api extends HttpClient + this.request< + { + /** base64safe encoded public signing key */ + sub?: string; + }, + Error + >({ + path: `/i_key/underlines/${iUk}`, + method: "GET", + format: "json", + ...params, + }), }; login = { /**