Skip to content

Commit

Permalink
Initial code commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Fernando Planella Gonzalez committed Jan 24, 2019
1 parent 13f110f commit 5a7ef43
Show file tree
Hide file tree
Showing 38 changed files with 3,121 additions and 69 deletions.
65 changes: 4 additions & 61 deletions .gitignore
@@ -1,61 +1,4 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next
node_modules
.directory
ng-openapi-gen.json
dist
5 changes: 5 additions & 0 deletions .jshintrc
@@ -0,0 +1,5 @@
{
"strict": false,
"esversion": 6,
"node": true
}
17 changes: 17 additions & 0 deletions .vscode/launch.json
@@ -0,0 +1,17 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run tests",
"program": "${workspaceFolder}/node_modules/jasmine-ts/lib/index",
"args": [
"tsconfig.json",
"--config=jasmine.json"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
15 changes: 15 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,15 @@
{
"editor.rulers": [
140
],
"spellright.language": "en_US",
"spellright.documentTypes": [
"markdown",
"latex",
"plaintext"
],
"typescript.preferences.quoteStyle": "single",
"typescript.preferences.importModuleSpecifier": "relative",
"editor.formatOnSave": true,
"typescript.tsdk": "node_modules/typescript/lib"
}
12 changes: 6 additions & 6 deletions LICENSE
@@ -1,6 +1,6 @@
MIT License
The MIT License

Copyright (c) 2019 Cyclos
Copyright (c) 2017 Social Trade Organisation.

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

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

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
16 changes: 14 additions & 2 deletions README.md
@@ -1,2 +1,14 @@
# ng-openapi-gen
An OpenAPI 3.0 codegen for Angular
ng-openapi-gen: An OpenAPI 3 code generator for Angular
---

This project is a NPM module that generates model interfaces and web service
clients from an [OpenApi 3](https://www.openapis.org/)
[specification](https://github.com/OAI/OpenAPI-Specification).
The generated classes follow the principles of
[Angular](https://angular.io/). The generated code is compatible with Angular 6+.

For a generator for [Swagger 2.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md),
use [ng-swagger-gen](https://github.com/cyclosproject/ng-swagger-gen) instead.

`ng-openapi-gen` is still in early development stage, and is not yet
recommended for production.
15 changes: 15 additions & 0 deletions jasmine.json
@@ -0,0 +1,15 @@
{
"spec_dir": "test",
"spec_files": [
"*.spec.ts"
],
"stopSpecOnExpectationFailure": false,
"reporters": [
{
"name": "jasmine-spec-reporter#SpecReporter",
"options": {
"displayStacktrace": "all"
}
}
]
}
109 changes: 109 additions & 0 deletions ng-openapi-gen-schema.json
@@ -0,0 +1,109 @@
{
"$schema": "http://json-schema.org/schema",
"id": "https://github.com/cyclosproject/ng-openapi-gen/blob/master/ng-openapi-gen-schema.json",
"title": "Options for ng-openapi-gen",
"type": "object",
"required": [
"input"
],
"properties": {
"$schema": {
"type": "string"
},
"input": {
"description": "The input file or URL to the OpenAPI 3 specification, JSON or YAML, local file or URL",
"type": "string"
},
"output": {
"description": "Where generated files will be written to. Defaults to 'src/app/api'.",
"type": "string",
"default": "src/app/api"
},
"prefix": {
"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`.",
"type": "string",
"default": "Api"
},
"defaultTag": {
"description": "Tag name assumed for operations without tags. Defaults to the value of 'prefix', which defaults to 'Api'.",
"type": "string"
},
"includeTags": {
"description": "When specified, filters the generated services, including only those corresponding to this list of tags.",
"type": "array",
"items": {
"type": "string"
}
},
"excludeTags": {
"description": "When specified, filters the generated services, excluding any service corresponding to this list of tags.",
"type": "array",
"items": {
"type": "string"
}
},
"ignoreUnusedModels": {
"description": "Indicates whether or not to ignore model files that are not referenced by any operation. Defaults to true.",
"type": "boolean",
"default": "true"
},
"removeStaleFiles": {
"description": "Indicates whether or not to remove any files in the output folder that were not generated by ng-swagger-gen. Defaults to true.",
"type": "boolean",
"default": "true"
},
"modelIndex": {
"description": "File name file that exports all models. Set to false to skip. Defaults to `models.ts`.",
"default": "models.ts",
"anyOf": [
{
"type": "string"
},
{
"type": "boolean"
}
]
},
"serviceIndex": {
"description": "File file that exports all services. Set to false to skip. Defaults to `services.ts`.",
"default": "services.ts",
"anyOf": [
{
"type": "string"
},
{
"type": "boolean"
}
]
},
"servicePrefix": {
"description": "Prefix for generated service classes. Defaults to empty.",
"type": "string",
"default": ""
},
"serviceSuffix": {
"description": "Suffix for generated service classes. Defaults to `Service`.",
"type": "string",
"default": "Service"
},
"modelPrefix": {
"description": "Prefix for generated model classes. Defaults to empty.",
"type": "string",
"default": ""
},
"modelSuffix": {
"description": "Suffix for generated model classes. Defaults to empty.",
"type": "string",
"default": ""
},
"apiModule": {
"description": "Indicates whether or not to generate the Angular module which provides all services. Defaults to true.",
"type": "boolean",
"default": "true"
},
"templates": {
"description": "Custom templates directory. Any `.mustache` files here will be used instead of the corresponding default.",
"type": "string"
}
}
}

0 comments on commit 5a7ef43

Please sign in to comment.