Skip to content

Commit 303e659

Browse files
authored
feat(open-api-gateway): add package for declarative apis written in OpenAPI (#28)
* feat(open-api-gateway): add package for declarative apis written in OpenAPI This commit adds a new `open-api-gateway` package, which contains both a projen project type and a CDK construct, designed to make writing REST APIs nice and easy. OpenAPI is used as the core framework for defining apis. Given an OpenAPI specification file, the CDK construct will create all API gateway resources to deploy the API. Additionally, client and server code is generated to provide type-safe usage and implementation of the API.
1 parent 6a7899f commit 303e659

File tree

63 files changed

+34570
-54
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+34570
-54
lines changed

.gitignore

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.ts

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { NXMonorepoProject } from "./private/projects/nx-monorepo-project";
2020
import { PDKMonorepoProject } from "./private/projects/pdk-monorepo-project";
2121
import { PipelineProject } from "./private/projects/pipeline-project";
2222
import { StaticWebsiteProject } from "./private/projects/static-website-project";
23+
import { OpenApiGatewayProject } from "./private/projects/open-api-gateway-project";
2324
import { PDKProject } from "./private/pdk-project";
2425

2526
// root/parent project
@@ -34,6 +35,7 @@ const pipelineProject = new PipelineProject(monorepoProject);
3435
const awsPrototypingSdkProject = new AwsPrototypingSdkProject(monorepoProject);
3536
new StaticWebsiteProject(monorepoProject);
3637
new IdentityProject(monorepoProject);
38+
new OpenApiGatewayProject(monorepoProject);
3739

3840
// implicit dependencies
3941
pipelineProject.samples.forEach((sample) =>

nx.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+146
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
{
2+
"env": {
3+
"jest": true,
4+
"node": true
5+
},
6+
"root": true,
7+
"plugins": [
8+
"@typescript-eslint",
9+
"import",
10+
"prettier",
11+
"header"
12+
],
13+
"parser": "@typescript-eslint/parser",
14+
"parserOptions": {
15+
"ecmaVersion": 2018,
16+
"sourceType": "module",
17+
"project": "./tsconfig.dev.json"
18+
},
19+
"extends": [
20+
"plugin:import/typescript",
21+
"prettier",
22+
"plugin:prettier/recommended"
23+
],
24+
"settings": {
25+
"import/parsers": {
26+
"@typescript-eslint/parser": [
27+
".ts",
28+
".tsx"
29+
]
30+
},
31+
"import/resolver": {
32+
"node": {},
33+
"typescript": {
34+
"project": "./tsconfig.dev.json",
35+
"alwaysTryTypes": true
36+
}
37+
}
38+
},
39+
"ignorePatterns": [
40+
"*.js",
41+
"!.projenrc.js",
42+
"*.d.ts",
43+
"node_modules/",
44+
"*.generated.ts",
45+
"coverage"
46+
],
47+
"rules": {
48+
"prettier/prettier": [
49+
"error"
50+
],
51+
"@typescript-eslint/no-require-imports": [
52+
"error"
53+
],
54+
"import/no-extraneous-dependencies": [
55+
"error",
56+
{
57+
"devDependencies": [
58+
"**/test/**",
59+
"**/test-integration/**"
60+
],
61+
"optionalDependencies": false,
62+
"peerDependencies": true
63+
}
64+
],
65+
"import/no-unresolved": [
66+
"off"
67+
],
68+
"import/order": [
69+
"warn",
70+
{
71+
"groups": [
72+
"builtin",
73+
"external"
74+
],
75+
"alphabetize": {
76+
"order": "asc",
77+
"caseInsensitive": true
78+
}
79+
}
80+
],
81+
"no-duplicate-imports": [
82+
"error"
83+
],
84+
"no-shadow": [
85+
"off"
86+
],
87+
"@typescript-eslint/no-shadow": [
88+
"error"
89+
],
90+
"key-spacing": [
91+
"error"
92+
],
93+
"no-multiple-empty-lines": [
94+
"error"
95+
],
96+
"@typescript-eslint/no-floating-promises": [
97+
"error"
98+
],
99+
"no-return-await": [
100+
"off"
101+
],
102+
"@typescript-eslint/return-await": [
103+
"error"
104+
],
105+
"no-trailing-spaces": [
106+
"error"
107+
],
108+
"dot-notation": [
109+
"error"
110+
],
111+
"no-bitwise": [
112+
"error"
113+
],
114+
"@typescript-eslint/member-ordering": [
115+
"error",
116+
{
117+
"default": [
118+
"public-static-field",
119+
"public-static-method",
120+
"protected-static-field",
121+
"protected-static-method",
122+
"private-static-field",
123+
"private-static-method",
124+
"field",
125+
"constructor",
126+
"method"
127+
]
128+
}
129+
],
130+
"header/header": [
131+
2,
132+
"../../header.js"
133+
]
134+
},
135+
"overrides": [
136+
{
137+
"files": [
138+
".projenrc.js"
139+
],
140+
"rules": {
141+
"@typescript-eslint/no-require-imports": "off",
142+
"import/no-extraneous-dependencies": "off"
143+
}
144+
}
145+
]
146+
}

packages/open-api-gateway/.gitattributes

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/open-api-gateway/.gitignore

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
2+
!/.gitattributes
3+
!/.projen/tasks.json
4+
!/.projen/deps.json
5+
!/.projen/files.json
6+
!/package.json
7+
!/LICENSE
8+
!/.npmignore
9+
logs
10+
*.log
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
lerna-debug.log*
15+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
16+
pids
17+
*.pid
18+
*.seed
19+
*.pid.lock
20+
lib-cov
21+
coverage
22+
*.lcov
23+
.nyc_output
24+
build/Release
25+
node_modules/
26+
jspm_packages/
27+
*.tsbuildinfo
28+
.eslintcache
29+
*.tgz
30+
.yarn-integrity
31+
.cache
32+
LICENSE_THIRD_PARTY
33+
!/.projenrc.js
34+
/test-reports/
35+
junit.xml
36+
/coverage/
37+
!/.prettierignore
38+
!/.prettierrc.json
39+
!/test/
40+
!/tsconfig.dev.json
41+
!/src/
42+
/lib
43+
/dist/
44+
!/.eslintrc.json
45+
.jsii
46+
tsconfig.json
47+
/dist/changelog.md
48+
/dist/version.txt

packages/open-api-gateway/.npmignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
2+
/.projen/
3+
/test-reports/
4+
junit.xml
5+
/coverage/
6+
/test/
7+
/tsconfig.dev.json
8+
/src/
9+
!/lib/
10+
!/lib/**/*.js
11+
!/lib/**/*.d.ts
12+
dist
13+
/tsconfig.json
14+
/.github/
15+
/.vscode/
16+
/.idea/
17+
/.projenrc.js
18+
tsconfig.tsbuildinfo
19+
/.eslintrc.json
20+
!.jsii
21+
/dist/changelog.md
22+
/dist/version.txt
23+
!LICENSE_THIRD_PARTY
24+
**/node_modules
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"overrides": []
3+
}

0 commit comments

Comments
 (0)