{"id":20077396,"url":"https://github.com/sius/swagger-nodegen-cli","last_synced_at":"2025-05-05T22:30:56.243Z","repository":{"id":25702383,"uuid":"106079897","full_name":"sius/swagger-nodegen-cli","owner":"sius","description":"A convenience node package to make the swagger-codegen-cli.jar availabe in the node/npm environment","archived":false,"fork":false,"pushed_at":"2023-01-16T13:14:14.000Z","size":109549,"stargazers_count":12,"open_issues_count":3,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-06T18:16:22.840Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-07T07:37:40.000Z","updated_at":"2024-06-18T05:12:31.000Z","dependencies_parsed_at":"2023-02-10T03:31:06.857Z","dependency_job_id":null,"html_url":"https://github.com/sius/swagger-nodegen-cli","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sius%2Fswagger-nodegen-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sius%2Fswagger-nodegen-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sius%2Fswagger-nodegen-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sius%2Fswagger-nodegen-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sius","download_url":"https://codeload.github.com/sius/swagger-nodegen-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224470972,"owners_count":17316708,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T15:08:02.120Z","updated_at":"2024-11-13T15:08:03.269Z","avatar_url":"https://github.com/sius.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swagger-nodegen-cli\n\nA convenience package for the **node/npm** environment that wraps the Java library \n**swagger-codegen-cli**\n\n## Prerequisites\n\nThe following dependencies would need to be installed on your machine before running the Swagger Codegen.\n\n- Java, version 7 or higher\n- The Java execution path must be on your environment variable `PATH`\n\n## Important Note\nThe current version of **swagger-codegen-cli-3.x.x** supports **fewer languages** ​​than the older versions (**2.x.x**):\n\n```console\nAvailable languages: [dart, aspnetcore, csharp, csharp-dotnet2, \ngo, go-server, dynamic-html, html, html2, java, \njaxrs-cxf-client, jaxrs-cxf, inflector, jaxrs-cxf-cdi, jaxrs-spec, jaxrs-jersey, jaxrs-di, jaxrs-resteasy-eap, jaxrs-resteasy, micronaut, spring, nodejs-server, openapi, openapi-yaml, kotlin-client, kotlin-server, php, python, python-flask, r, ruby, scala, scala-akka-http-server, swift3, swift4, swift5, typescript-angular, typescript-axios, typescript-fetch, javascript]\n```\n\n## Installation\n\n### Npm package for use with [swagger-codegen-cli-3.0.35.jar](https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.35/swagger-codegen-cli-3.0.35.jar)\n\n`npm install -g swagger-nodegen-cli`\n\n### Npm package for use with [swagger-codegen-cli-2.4.4.jar](http://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.4/swagger-codegen-cli-2.4.4.jar)\n\n`npm install -g swagger-nodegen-cli@2.4.4`\n\n## Usage\nSame as **swagger-codegen-cli.jar** without `java -jar ...`\nThe main command is **sc**, **swagger-codegen-cli** or **swagger-nodegen-cli** (under Windows **sc** is in conflict with `sc.exe`)\n\n`usage: swagger-codegen-cli \u003ccommand\u003e [\u003cargs\u003e]`\n\n`usage: swagger-nodegen-cli \u003ccommand\u003e [\u003cargs\u003e]`\n\n`usage: sc \u003ccommand\u003e [\u003cargs\u003e]` (under windows `sc` is in conflicts with `sc.exe`)\n\n- Version 2.4.4 ([Version 2.4.4](https://www.npmjs.com/package/swagger-nodegen-cli/v/2.4.4))\n\n## Examples\n\n### Display help, extended help, version and available languages\n\n```console\n# help, extended help\nswagger-codegen-cli -h\nswagger-codegen-cli generate -h\n\n# Version\nswagger-codegen-cli version\n\n# Available languages\nswagger-codegen-cli\nswagger-codegen-cli langs\n\n```\n\n### Display detailed generation config options for a specific language\n\n```console\nswagger-codegen-cli config-help -l typescript-angular\n```\n\n### Generate openapi.json (v3) from swagger.json (v2) or openapi.yaml (v3)\n\n```console\nswagger-codegen-cli generate -l openapi -i \u003cpath/to/[swagger.json|openapi.yaml]\u003e -o \u003cout folder\u003e\n\n```\n\n### Generate openapi.yaml (v3) from swagger.json (v2) or openapi.json (v3)\n\n```console\nswagger-codegen-cli generate -l openapi-yaml -i \u003cpath/to/[swagger|openapi].json\u003e -o \u003cout folder\u003e\n\n```\n\n### Generate a typescript-angular service from an Open API V2 (`swagger`)/V3 - JSON or YML file\n\n#### Features\n\n- Generates an Angular service per defined swagger resource\n- Generates models with custom property name flavours: camelCase, PascalCase, snake_case ... (see `swagger-codegen-cli config-help -l typescript-angular`)\n- Base path injection with InjectionToken\n\n```console\nswagger-codegen-cli generate -i swagger.json -l typescript-angular -o src/services\nswagger-codegen-cli generate -i open-api.yml -l typescript-angular -o src/services\n```\n\n#### Integration into an Angular application\n\n```tree\n\n|-- angular-application\n|-- src\n|   |-- app\n|   |   |-- app.component.html\n|   |   |-- app.component.ts\n|   |   |-- app.component.css\n|   |   |-- app.module.ts\n|   `-- services\n|       |-- ...\n\n```\n\n`./src/app/app.module.ts`\n\n```typescript\nimport { NgModule } from '@angular/core';\nimport { HttpClientModule } from '@angular/common/http';\nimport { BrowserModule }  from '@angular/platform-browser';\nimport { AppComponent } from './app.component';\nimport { ApiModule, BASE_PATH } from '../services';\n\n@NgModule({\n  imports: [\n    BrowserModule,\n    HttpClientModule,\n    ApiModule\n  ],\n  declarations: [\n    AppComponent\n  ],\n  providers: [\n    { provide: BASE_PATH, useValue: 'http://localhost:10010' }\n  ],\n  bootstrap: [ AppComponent ]\n})\nexport class AppModule { }\n```\n\n### Generate a nodjs-server skelton from an Open API V2 (`swagger`)/V3 - JSON or YML file\n\n```console\n\nswagger-codegen-cli generate -i swagger.json -l nodejs-server -o my-server\nswagger-codegen-cli generate -i open-api.yml -l nodejs-server -o my-server\n\n```\n\n## Links\n\n- [swagger-codegen](https://github.com/swagger-api/swagger-codegen)\n\n- [swagger-tools](https://swagger.io/docs/swagger-tools/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsius%2Fswagger-nodegen-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsius%2Fswagger-nodegen-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsius%2Fswagger-nodegen-cli/lists"}