Skip to content

Commit ce9bc18

Browse files
authored
Merge pull request #9 from kikuomax/fix-path-pattern
Fix path pattern
2 parents 2876ae4 + 015c4f6 commit ce9bc18

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

README.ja.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
このレポジトリを依存関係(`dependencies`)に追加してください。
2222

2323
```sh
24-
npm install https://github.com/codemonger-io/cdk-rest-api-with-spec.git#v0.2.0
24+
npm install https://github.com/codemonger-io/cdk-rest-api-with-spec.git#v0.2.1
2525
```
2626

2727
このライブラリはCDK v2プロジェクトで使用することを想定しており、以下のモジュールは`dependencies`ではなく`peerDependencies`に含んでいます。

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This library is implemented for the CDK **version 2** (CDK v2) and does not work
2121
Please add this repository to your dependencies.
2222

2323
```sh
24-
npm install https://github.com/codemonger-io/cdk-rest-api-with-spec.git#v0.2.0
24+
npm install https://github.com/codemonger-io/cdk-rest-api-with-spec.git#v0.2.1
2525
```
2626

2727
This library is supposed to be used in a CDK v2 project, so it does not include the following modules in the `dependencies` but does in the `peerDependencies`.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cdk-rest-api-with-spec",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "Describe Amazon API Gateway and OpenAPI at once with CDK",
55
"main": "./dist/index.js",
66
"typings": "./dist/index.d.ts",
@@ -12,6 +12,7 @@
1212
"scripts": {
1313
"build": "rollup -c && api-extractor run --local",
1414
"build:tsc": "tsc",
15+
"type-check": "tsc --noEmit",
1516
"prepare": "npm run build",
1617
"doc": "npm run build && api-documenter markdown --input-folder ./temp --output-folder ./api-docs/markdown",
1718
"test": "echo \"Error: no test specified\" && exit 1"

src/rest-api-with-spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ function translatePathPart(
337337
resource: IResourceWithSpec,
338338
): ParameterObject[] | undefined {
339339
// locates /{name} at the end
340-
const match = resource.path.match(/\/\{(.+)\}$/);
340+
// `name` must not contain a slash: https://github.com/codemonger-io/cdk-rest-api-with-spec/issues/8
341+
const match = resource.path.match(/\/\{([^\/]+)\}$/);
341342
if (match == null) {
342343
return undefined;
343344
}

0 commit comments

Comments
 (0)