Skip to content

Commit ce6f683

Browse files
authored
Merge branch 'ferdikoomen:master' into base-url-change
2 parents e3148aa + eaed512 commit ce6f683

28 files changed

+4310
-5164
lines changed

.circleci/config.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
version: 2
22
jobs:
33
build:
4-
working_directory: ~/repo
54
docker:
65
- image: cimg/node:lts-browsers
6+
resource_class: large
7+
working_directory: ~/repo
78
steps:
89
- checkout
910
- restore_cache:
1011
keys:
11-
- v1-dependencies-{{ checksum "package.json" }}
12+
- v1-dependencies-{{ checksum "package-lock.json" }}
1213
- v1-dependencies-
1314
- run:
1415
name: Install dependencies
15-
command: npm install --force
16+
command: npm install
1617
- save_cache:
17-
key: v1-dependencies-{{ checksum "package.json" }}
18+
key: v1-dependencies-{{ checksum "package-lock.json" }}
1819
paths:
1920
- node_modules
2021
- run:
2122
name: Build library
2223
command: npm run release
2324
- run:
2425
name: Run unit tests
25-
command: npm run test:coverage
26-
- run:
27-
name: Run e2e tests
28-
command: npm run test:e2e
26+
command: npm run test
27+
# - run:
28+
# name: Run e2e tests
29+
# command: npm run test:e2e
2930
- run:
3031
name: Submit to Codecov
3132
command: npm run codecov

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ $ openapi --help
4848
--exportModels <value> Write models to disk (default: true)
4949
--exportSchemas <value> Write schemas to disk (default: false)
5050
--indent <value> Indentation options [4, 2, tab] (default: "4")
51-
--postfix <value> Service name postfix (default: "Service")
51+
--postfixServices Service name postfix (default: "Service")
52+
--postfixModels Model name postfix
5253
--request <value> Path to custom request file
5354
-h, --help display help for command
5455

bin/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ const params = program
2121
.option('--exportModels <value>', 'Write models to disk', true)
2222
.option('--exportSchemas <value>', 'Write schemas to disk', false)
2323
.option('--indent <value>', 'Indentation options [4, 2, tabs]', '4')
24-
.option('--postfix <value>', 'Service name postfix', 'Service')
24+
.option('--postfix <value>', 'Deprecated: Use --postfixServices instead. Service name postfix', 'Service')
25+
.option('--postfixServices <value>', 'Service name postfix', 'Service')
26+
.option('--postfixModels <value>', 'Model name postfix')
2527
.option('--request <value>', 'Path to custom request file')
2628
.parse(process.argv)
2729
.opts();
@@ -41,7 +43,8 @@ if (OpenAPI) {
4143
exportModels: JSON.parse(params.exportModels) === true,
4244
exportSchemas: JSON.parse(params.exportSchemas) === true,
4345
indent: params.indent,
44-
postfix: params.postfix,
46+
postfixServices: params.postfixServices ?? params.postfix,
47+
postfixModels: params.postfixModels,
4548
request: params.request,
4649
})
4750
.then(() => {

bin/index.spec.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ describe('bin', () => {
3434
'true',
3535
'--indent',
3636
'4',
37-
'--postfix',
37+
'--postfixServices',
3838
'Service',
39+
'--postfixModels',
40+
'Dto',
3941
]);
4042
expect(result.stdout.toString()).toBe('');
4143
expect(result.stderr.toString()).toBe('');
@@ -67,4 +69,18 @@ describe('bin', () => {
6769
expect(result.stdout.toString()).toContain(`-o, --output <value>`);
6870
expect(result.stderr.toString()).toBe('');
6971
});
72+
73+
it('should still support the deprecated --postfix parameter', () => {
74+
const result = crossSpawn.sync('node', [
75+
'./bin/index.js',
76+
'--input',
77+
'./test/spec/v3.json',
78+
'--output',
79+
'./test/generated/bin',
80+
'--postfix',
81+
'Service',
82+
]);
83+
expect(result.stdout.toString()).toBe('');
84+
expect(result.stderr.toString()).toBe('');
85+
});
7086
});

docs/basic-usage.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ $ openapi --help
1818
--exportModels <value> Write models to disk (default: true)
1919
--exportSchemas <value> Write schemas to disk (default: false)
2020
--indent <value> Indentation options [4, 2, tab] (default: "4")
21-
--postfix <value> Service name postfix (default: "Service")
21+
--postfixServices Service name postfix (default: "Service")
22+
--postfixModels Model name postfix
2223
--request <value> Path to custom request file
2324
-h, --help display help for command
2425

0 commit comments

Comments
 (0)