Skip to content

Commit fd18c23

Browse files
committed
Update the regex to be more concise and inclue 1 letter params
acacode#686 (comment)
1 parent 1d9a29c commit fd18c23

File tree

4 files changed

+80
-1
lines changed

4 files changed

+80
-1
lines changed

src/schema-routes/schema-routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class SchemaRoutes {
110110
originalRouteName;
111111

112112
const pathParamMatches = (routeName || '').match(
113-
/({(([A-z]){1}([a-zA-Z0-9-_.]-?_?\.?)+)([0-9]+)?})|(:(([A-z]){1}([a-zA-Z0-9-_.]-?_?\.?)+)([0-9]+)?:?)/g,
113+
/({[a-zA-Z]([a-zA-Z0-9-_.])*})|(:[a-zA-Z]([-_.]?[a-zA-Z0-9-_.])*:?)/g,
114114
);
115115

116116
// used in case when path parameters is not declared in requestInfo.parameters ("in": "path")

tests/spec/extractRequestParams/expected.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,27 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
496496
format: "json",
497497
...params,
498498
}),
499+
500+
/**
501+
* @description Get public details of an Authentiq ID.
502+
*
503+
* @tags key, get
504+
* @name UnderlinesDetail
505+
* @request GET:/i_key/underlines/{i__UK}
506+
*/
507+
underlinesDetail: (iUk: string, params: RequestParams = {}) =>
508+
this.request<
509+
{
510+
/** base64safe encoded public signing key */
511+
sub?: string;
512+
},
513+
Error
514+
>({
515+
path: `/i_key/underlines/${iUk}`,
516+
method: "GET",
517+
format: "json",
518+
...params,
519+
}),
499520
};
500521
login = {
501522
/**

tests/spec/extractRequestParams/schema.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@
5656
"required": true,
5757
"type": "string"
5858
},
59+
"i__UK": {
60+
"description": "Variable with double __ in it.",
61+
"in": "path",
62+
"name": "i__UK",
63+
"required": true,
64+
"type": "string"
65+
},
5966
"i_PK": {
6067
"description": "Public Signing Key - Authentiq ID (43 chars)",
6168
"in": "path",
@@ -480,6 +487,36 @@
480487
"tags": ["key", "get"]
481488
}
482489
},
490+
"/i_key/underlines/{i__UK}": {
491+
"get": {
492+
"description": "Get public details of an Authentiq ID.\n",
493+
"parameters": [
494+
{
495+
"$ref": "#/parameters/i__UK"
496+
}
497+
],
498+
"produces": ["application/json"],
499+
"responses": {
500+
"200": {
501+
"description": "Successfully retrieved",
502+
"schema": {
503+
"properties": {
504+
"sub": {
505+
"description": "base64safe encoded public signing key",
506+
"type": "string"
507+
}
508+
},
509+
"title": "JWT",
510+
"type": "object"
511+
}
512+
},
513+
"default": {
514+
"$ref": "#/responses/ErrorResponse"
515+
}
516+
},
517+
"tags": ["key", "get"]
518+
}
519+
},
483520
"/login": {
484521
"post": {
485522
"consumes": ["application/jwt"],

tests/spec/extractRequestParams/schema.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,27 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
496496
format: "json",
497497
...params,
498498
}),
499+
500+
/**
501+
* @description Get public details of an Authentiq ID.
502+
*
503+
* @tags key, get
504+
* @name UnderlinesDetail
505+
* @request GET:/i_key/underlines/{i__UK}
506+
*/
507+
underlinesDetail: (iUk: string, params: RequestParams = {}) =>
508+
this.request<
509+
{
510+
/** base64safe encoded public signing key */
511+
sub?: string;
512+
},
513+
Error
514+
>({
515+
path: `/i_key/underlines/${iUk}`,
516+
method: "GET",
517+
format: "json",
518+
...params,
519+
}),
499520
};
500521
login = {
501522
/**

0 commit comments

Comments
 (0)