Skip to content

Commit 3de4a49

Browse files
authored
Merge branch 'master' into master
2 parents cf4f78b + d0a3351 commit 3de4a49

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

+6741
-19083
lines changed

.github/workflows/codeql.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
schedule:
9+
- cron: "44 20 * * 3"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [ javascript ]
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v2
31+
with:
32+
languages: ${{ matrix.language }}
33+
queries: +security-and-quality
34+
35+
- name: Autobuild
36+
uses: github/codeql-action/autobuild@v2
37+
38+
- name: Perform CodeQL Analysis
39+
uses: github/codeql-action/analyze@v2
40+
with:
41+
category: "/language:${{ matrix.language }}"

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [0.24.0] - 2023-04-10
5+
### Fixed
6+
- Upgraded dependencies
7+
- Fixed issue with Cancelable promise
8+
- Fixed issue with escaping reserved keywords in schema names
9+
### Added
10+
- Added `--postfixModels` option
11+
412
## [0.23.0] - 2022-06-02
513
### Fixed
614
- Upgraded dependencies

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM node:alpine
2+
WORKDIR /usr/src/openapi
3+
COPY . /usr/src/openapi
4+
RUN npm install
5+
RUN npm run release
6+
ENTRYPOINT [ "node", "/usr/src/openapi/bin/index.js" ]
7+
CMD "--help"

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
[![NPM][npm-image]][npm-url]
44
[![License][license-image]][license-url]
55
[![Coverage][coverage-image]][coverage-url]
6-
[![Quality][quality-image]][quality-url]
7-
[![Code Climate][climate-image]][climate-url]
6+
[![Coverage][coverage-image]][coverage-url]
87
[![Downloads][downloads-image]][downloads-url]
98
[![Build][build-image]][build-url]
109

@@ -14,7 +13,7 @@
1413
- Frontend ❤️ OpenAPI, but we do not want to use JAVA codegen in our builds
1514
- Quick, lightweight, robust and framework-agnostic 🚀
1615
- Supports generation of TypeScript clients
17-
- Supports generations of Fetch, [Node-Fetch](#node-fetch-support), [Axios](#axios-support), [Angular](#angular-support) and XHR http clients
16+
- Supports generations of Fetch, Node-Fetch, Axios, Angular and XHR http clients
1817
- Supports OpenAPI specification v2.0 and v3.0
1918
- Supports JSON and YAML files for input
2019
- Supports generation through CLI, Node.js and NPX
@@ -59,6 +58,21 @@ $ openapi --help
5958
$ openapi --input ./spec.json --output ./generated --client xhr
6059
```
6160

61+
## Docker usage
62+
63+
To build the Docker container, execute the following command:
64+
65+
```
66+
docker build . --tag openapi-typescript-codegen
67+
```
68+
69+
After this is done, you can execute the CLI commands:
70+
71+
```
72+
docker run openapi-typescript-codegen --help
73+
docker run openapi-typescript-codegen --input sample.yaml --output client
74+
```
75+
6276
Documentation
6377
===
6478
- [Basic usage](docs/basic-usage.md)
@@ -87,10 +101,6 @@ Support
87101
[license-image]: http://img.shields.io/npm/l/openapi-typescript-codegen.svg
88102
[coverage-url]: https://codecov.io/gh/ferdikoomen/openapi-typescript-codegen
89103
[coverage-image]: https://img.shields.io/codecov/c/github/ferdikoomen/openapi-typescript-codegen.svg
90-
[quality-url]: https://lgtm.com/projects/g/ferdikoomen/openapi-typescript-codegen
91-
[quality-image]: https://img.shields.io/lgtm/grade/javascript/g/ferdikoomen/openapi-typescript-codegen.svg
92-
[climate-url]: https://codeclimate.com/github/ferdikoomen/openapi-typescript-codegen
93-
[climate-image]: https://img.shields.io/codeclimate/maintainability/ferdikoomen/openapi-typescript-codegen.svg
94104
[downloads-url]: http://npm-stat.com/charts.html?package=openapi-typescript-codegen
95105
[downloads-image]: http://img.shields.io/npm/dm/openapi-typescript-codegen.svg
96106
[build-url]: https://circleci.com/gh/ferdikoomen/openapi-typescript-codegen/tree/master

bin/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const params = program
2222
.option('--exportModels <value>', 'Write models to disk', true)
2323
.option('--exportSchemas <value>', 'Write schemas to disk', false)
2424
.option('--indent <value>', 'Indentation options [4, 2, tabs]', '4')
25-
.option('--postfix <value>', 'Deprecated: Use --postfixServices instead. Service name postfix', 'Service')
2625
.option('--postfixServices <value>', 'Service name postfix', 'Service')
2726
.option('--postfixModels <value>', 'Model name postfix')
2827
.option('--request <value>', 'Path to custom request file')
@@ -45,7 +44,7 @@ if (OpenAPI) {
4544
exportModels: JSON.parse(params.exportModels) === true,
4645
exportSchemas: JSON.parse(params.exportSchemas) === true,
4746
indent: params.indent,
48-
postfixServices: params.postfixServices ?? params.postfix,
47+
postfixServices: params.postfixServices,
4948
postfixModels: params.postfixModels,
5049
request: params.request,
5150
})

bin/index.spec.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,4 @@ describe('bin', () => {
7070
expect(result.stdout.toString()).toContain(`-o, --output <value>`);
7171
expect(result.stderr.toString()).toBe('');
7272
});
73-
74-
it('should still support the deprecated --postfix parameter', () => {
75-
const result = crossSpawn.sync('node', [
76-
'./bin/index.js',
77-
'--input',
78-
'./test/spec/v3.json',
79-
'--output',
80-
'./test/generated/bin',
81-
'--postfix',
82-
'Service',
83-
]);
84-
expect(result.stdout.toString()).toBe('');
85-
expect(result.stderr.toString()).toBe('');
86-
});
8773
});

docs/angular-support.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ If you want to generate the Angular based client then you can specify `--client
99
The Angular client has been tested with the following versions:
1010

1111
```
12-
"@angular/common": "14.0.x",
13-
"@angular/core": "14.0.x",
12+
"@angular/common": "15.0.x",
13+
"@angular/core": "15.0.x",
1414
"rxjs": "7.5.x",
1515
```
1616

0 commit comments

Comments
 (0)