Skip to content

Commit 5a7ef43

Browse files
author
Luis Fernando Planella Gonzalez
committed
Initial code commit
1 parent 13f110f commit 5a7ef43

38 files changed

+3121
-69
lines changed

.gitignore

+4-61
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,4 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
8-
# Runtime data
9-
pids
10-
*.pid
11-
*.seed
12-
*.pid.lock
13-
14-
# Directory for instrumented libs generated by jscoverage/JSCover
15-
lib-cov
16-
17-
# Coverage directory used by tools like istanbul
18-
coverage
19-
20-
# nyc test coverage
21-
.nyc_output
22-
23-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24-
.grunt
25-
26-
# Bower dependency directory (https://bower.io/)
27-
bower_components
28-
29-
# node-waf configuration
30-
.lock-wscript
31-
32-
# Compiled binary addons (https://nodejs.org/api/addons.html)
33-
build/Release
34-
35-
# Dependency directories
36-
node_modules/
37-
jspm_packages/
38-
39-
# TypeScript v1 declaration files
40-
typings/
41-
42-
# Optional npm cache directory
43-
.npm
44-
45-
# Optional eslint cache
46-
.eslintcache
47-
48-
# Optional REPL history
49-
.node_repl_history
50-
51-
# Output of 'npm pack'
52-
*.tgz
53-
54-
# Yarn Integrity file
55-
.yarn-integrity
56-
57-
# dotenv environment variables file
58-
.env
59-
60-
# next.js build output
61-
.next
1+
node_modules
2+
.directory
3+
ng-openapi-gen.json
4+
dist

.jshintrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"strict": false,
3+
"esversion": 6,
4+
"node": true
5+
}

.vscode/launch.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "node",
6+
"request": "launch",
7+
"name": "Run tests",
8+
"program": "${workspaceFolder}/node_modules/jasmine-ts/lib/index",
9+
"args": [
10+
"tsconfig.json",
11+
"--config=jasmine.json"
12+
],
13+
"console": "integratedTerminal",
14+
"internalConsoleOptions": "neverOpen"
15+
}
16+
]
17+
}

.vscode/settings.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"editor.rulers": [
3+
140
4+
],
5+
"spellright.language": "en_US",
6+
"spellright.documentTypes": [
7+
"markdown",
8+
"latex",
9+
"plaintext"
10+
],
11+
"typescript.preferences.quoteStyle": "single",
12+
"typescript.preferences.importModuleSpecifier": "relative",
13+
"editor.formatOnSave": true,
14+
"typescript.tsdk": "node_modules/typescript/lib"
15+
}

LICENSE

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
MIT License
1+
The MIT License
22

3-
Copyright (c) 2019 Cyclos
3+
Copyright (c) 2017 Social Trade Organisation.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99
copies of the Software, and to permit persons to whom the Software is
1010
furnished to do so, subject to the following conditions:
1111

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
1414

1515
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
1-
# ng-openapi-gen
2-
An OpenAPI 3.0 codegen for Angular
1+
ng-openapi-gen: An OpenAPI 3 code generator for Angular
2+
---
3+
4+
This project is a NPM module that generates model interfaces and web service
5+
clients from an [OpenApi 3](https://www.openapis.org/)
6+
[specification](https://github.com/OAI/OpenAPI-Specification).
7+
The generated classes follow the principles of
8+
[Angular](https://angular.io/). The generated code is compatible with Angular 6+.
9+
10+
For a generator for [Swagger 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md),
11+
use [ng-swagger-gen](https://github.com/cyclosproject/ng-swagger-gen) instead.
12+
13+
`ng-openapi-gen` is still in early development stage, and is not yet
14+
recommended for production.

jasmine.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"spec_dir": "test",
3+
"spec_files": [
4+
"*.spec.ts"
5+
],
6+
"stopSpecOnExpectationFailure": false,
7+
"reporters": [
8+
{
9+
"name": "jasmine-spec-reporter#SpecReporter",
10+
"options": {
11+
"displayStacktrace": "all"
12+
}
13+
}
14+
]
15+
}

ng-openapi-gen-schema.json

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{
2+
"$schema": "http://json-schema.org/schema",
3+
"id": "https://github.com/cyclosproject/ng-openapi-gen/blob/master/ng-openapi-gen-schema.json",
4+
"title": "Options for ng-openapi-gen",
5+
"type": "object",
6+
"required": [
7+
"input"
8+
],
9+
"properties": {
10+
"$schema": {
11+
"type": "string"
12+
},
13+
"input": {
14+
"description": "The input file or URL to the OpenAPI 3 specification, JSON or YAML, local file or URL",
15+
"type": "string"
16+
},
17+
"output": {
18+
"description": "Where generated files will be written to. Defaults to 'src/app/api'.",
19+
"type": "string",
20+
"default": "src/app/api"
21+
},
22+
"prefix": {
23+
"description": "A prefix to the generated global classes, such as `Configuration` and `Module`. Defaults to 'Api', so the default generated files are `ApiConfiguration` and `ApiModule`.",
24+
"type": "string",
25+
"default": "Api"
26+
},
27+
"defaultTag": {
28+
"description": "Tag name assumed for operations without tags. Defaults to the value of 'prefix', which defaults to 'Api'.",
29+
"type": "string"
30+
},
31+
"includeTags": {
32+
"description": "When specified, filters the generated services, including only those corresponding to this list of tags.",
33+
"type": "array",
34+
"items": {
35+
"type": "string"
36+
}
37+
},
38+
"excludeTags": {
39+
"description": "When specified, filters the generated services, excluding any service corresponding to this list of tags.",
40+
"type": "array",
41+
"items": {
42+
"type": "string"
43+
}
44+
},
45+
"ignoreUnusedModels": {
46+
"description": "Indicates whether or not to ignore model files that are not referenced by any operation. Defaults to true.",
47+
"type": "boolean",
48+
"default": "true"
49+
},
50+
"removeStaleFiles": {
51+
"description": "Indicates whether or not to remove any files in the output folder that were not generated by ng-swagger-gen. Defaults to true.",
52+
"type": "boolean",
53+
"default": "true"
54+
},
55+
"modelIndex": {
56+
"description": "File name file that exports all models. Set to false to skip. Defaults to `models.ts`.",
57+
"default": "models.ts",
58+
"anyOf": [
59+
{
60+
"type": "string"
61+
},
62+
{
63+
"type": "boolean"
64+
}
65+
]
66+
},
67+
"serviceIndex": {
68+
"description": "File file that exports all services. Set to false to skip. Defaults to `services.ts`.",
69+
"default": "services.ts",
70+
"anyOf": [
71+
{
72+
"type": "string"
73+
},
74+
{
75+
"type": "boolean"
76+
}
77+
]
78+
},
79+
"servicePrefix": {
80+
"description": "Prefix for generated service classes. Defaults to empty.",
81+
"type": "string",
82+
"default": ""
83+
},
84+
"serviceSuffix": {
85+
"description": "Suffix for generated service classes. Defaults to `Service`.",
86+
"type": "string",
87+
"default": "Service"
88+
},
89+
"modelPrefix": {
90+
"description": "Prefix for generated model classes. Defaults to empty.",
91+
"type": "string",
92+
"default": ""
93+
},
94+
"modelSuffix": {
95+
"description": "Suffix for generated model classes. Defaults to empty.",
96+
"type": "string",
97+
"default": ""
98+
},
99+
"apiModule": {
100+
"description": "Indicates whether or not to generate the Angular module which provides all services. Defaults to true.",
101+
"type": "boolean",
102+
"default": "true"
103+
},
104+
"templates": {
105+
"description": "Custom templates directory. Any `.mustache` files here will be used instead of the corresponding default.",
106+
"type": "string"
107+
}
108+
}
109+
}

0 commit comments

Comments
 (0)