{"id":15056573,"url":"https://github.com/mermade/openapi-codegen","last_synced_at":"2025-04-13T02:09:07.441Z","repository":{"id":26845777,"uuid":"110697603","full_name":"Mermade/openapi-codegen","owner":"Mermade","description":"OpenAPI 3.0 CodeGen plus Node.js minus the Java and emojis","archived":false,"fork":false,"pushed_at":"2023-01-23T20:37:17.000Z","size":3478,"stargazers_count":294,"open_issues_count":24,"forks_count":47,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-13T02:08:56.747Z","etag":null,"topics":["api","bash","client-g","clojure","code-","code-gene","codegen","documentation","groovy","javascript","node","nodejs","openapi","openapi-codegen","openapi3","php","python","server-generator","swagger","typescript"],"latest_commit_sha":null,"homepage":"https://mermade.github.io/openapi-codegen","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/Mermade.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-14T14:02:19.000Z","updated_at":"2024-10-28T14:36:06.000Z","dependencies_parsed_at":"2023-02-13T08:10:12.241Z","dependency_job_id":null,"html_url":"https://github.com/Mermade/openapi-codegen","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mermade%2Fopenapi-codegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mermade%2Fopenapi-codegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mermade%2Fopenapi-codegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mermade%2Fopenapi-codegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mermade","download_url":"https://codeload.github.com/Mermade/openapi-codegen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654091,"owners_count":21140236,"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":["api","bash","client-g","clojure","code-","code-gene","codegen","documentation","groovy","javascript","node","nodejs","openapi","openapi-codegen","openapi3","php","python","server-generator","swagger","typescript"],"created_at":"2024-09-24T21:53:34.744Z","updated_at":"2025-04-13T02:09:07.413Z","avatar_url":"https://github.com/Mermade.png","language":"JavaScript","readme":"# OpenAPI-CodeGen\n\n[![Build status](https://travis-ci.org/Mermade/openapi-codegen.svg?branch=master)](https://travis-ci.org/Mermade/openapi-codegen)\n\nNode.js-based codegen for OpenAPI documents. This project was initially a 24-hour hackathon. The local model adaptor code is entirely original and has been reverse-engineered from the existing documentation and template usage.\n\n**Work in progress**\n\nSupports OpenAPI 3.0.x natively, and Swagger/OpenAPI 1.2 and 2.0 by internal conversion. Node.js LTS versions are supported.\n\n## Usage\n\n### Installing\n\n`npm i -g openapi-codegen`\n\nor\n\n* clone the repository, and\n* `npm i`\n\nor\n\n`npx -p openapi-codegen cg ...`\n\n### CLI\n\n```\ncg [options] {[path]configName} {openapi-definition}\n\nOptions:\n  --help           Show help                                           [boolean]\n  --version        Show version number                                 [boolean]\n  --filter         Filter term to use with --list                       [string]\n  --list           List available templates for provider (og or sc)     [string]\n  -d, --debug      Turn on debugging information in the model          [boolean]\n  -f, --flat       Do not include config-name in output directory structure\n                                                                       [boolean]\n  -l, --lint       Lint input definition                               [boolean]\n  -o, --output     Specify output directory         [string] [default: \"./out/\"]\n  -s, --stools     Use swagger-tools to validate OpenAPI 2.0 definitions\n                                                                       [boolean]\n  -t, --templates  Specify templates directory                          [string]\n  -v, --verbose    Increase verbosity                                  [boolean]\n  -z, --zip        Create a .zip file instead of individual files      [boolean]\n```\n\ne.g.\n\n```\nnode cg --verbose nodejs defs/generator.yaml\n```\n\nIn this case, the generated code will be written to the `.out/nodejs` directory.\n\nYou can also load the OpenAPI definition from a URL.\n\n### API\n\n```javascript\nconst renderer = require('openapi-codegen');\n// load a config and a definition\nrenderer.main(definition,config,configName);\n```\n\n## Templates\n\nThe local templates were taken directly from `swagger-codegen`. This project is also licensed under [Apache-2.0](LICENSE) for this reason. Generated code is explicitly covered by the [Unlicense](templates/_common/UNLICENSE). Code to downconvert OpenAPI 3.0 definitions is taken from [Angular-Swagger-UI](https://github.com/Orange-OpenSource/angular-swagger-ui) and is MIT licensed.\n\nYou can also use the latest online templates from two providers: `og` ([openapi-generator](https://github.com/OpenAPITools/openapi-generator)) and `sc` ([swagger-codegen](https://github.com/swagger-api/swagger-codegen)). The `--list` and `--filter` options allow you to see which templates are available. Note that using the online templates involves sending your API definition to a remote server.\n\n### Contributors\n\nSee [here](https://github.com/swagger-api/swagger-codegen#template-creator) for a partial list of template contributors.\n\n### Status of the template configurations\n\nThe local templates with a status have a working (if not necessarily tested) configuration in the **configs** directory. Contributions are welcomed from the community of new and updated configurations and template updates.\n\n\u003cdetails\u003e\n\u003csummary\u003eClick here to expand...\u003c/summary\u003e\n\n|Template|Type|Status|README|Authors (TODO)|Config Maintainer|\n|---|---|---|---|---|---|\n|**\\_common**|meta| *contains Apache-2.0 and Unlicense licenses*||\n|**Ada**|client|**Untested**\n|akka-scala||\n|android||\n|**apache2**|configuration|**needs work**||\n|apex||\n|aspnetcore||\n|**bash**|client|**Syntax ok, needs testing**||@bkryza|@MikeRalphson\n|**clojure**|client|**Untested**|\n|**codegen**|meta|**Demo only**|||@MikeRalphson\n|**confluenceWikiDocs**|documentation|**Tested** with Docker [server](https://hub.docker.com/r/atlassian/confluence-server/)||\n|cpprest||\n|csharp||\n|**csharp-dotnet2**|client|**Untested**||\n|dart||\n|**debug**|meta|*used for dumping the model state*||@Mermade|@MikeRalphson\n|Eiffel||\n|elixir||\n|**erlang-client**|client|**Untested**||\n|erlang-server|server|\n|finch||\n|flash||\n|**flaskConnexion**|server|**Needs testing**||\n|**go**|client|**Builds, needs testing**||\n|**go-server**|server|**Builds and runs**||\n|**Groovy**|?|**untested**||\n|haskell-http-client|client||||\n|**haskell-servant**|server|**Untested**||\n|**htmlDocs**|documentation|*Appears to work*||\n|**htmlDocs2**|documentation|*Appears to work, no console errors logged*||\n|Java||\n|JavaInflector||\n|JavaJaxRS||\n|JavaPlayFramework||\n|**Javascript**|client|**Untested**||\n|**Javascript-Closure-Angular**|client|**Untested**\n|JavaSpring||\n|JavaVertXServer||\n|**JMeter**|meta|**Untested**||\n|kotlin-client||\n|**lua**|client|**Compiles OK**|\n|lumen||\n|MSF4J||\n|nancyfx||\n|**nodejs**|server|**tested** :white_check_mark:||@jfiala|@MikeRalphson|\n|objc||\n|**openapi**|meta|*outputs the input definition (in OpenAPI 3.0.x form)* :white_check_mark:||@Mermade|@MikeRalphson\n|perl||\n|php||\n|**php-silex**|?|**untested**||\n|php-symfony||\n|pistache-server||\n|powershell||\n|**python**|client|**needs testing**|||@mpnordland\n|qt5cpp||\n|r||\n|rails5||\n|**restbed**|server|**Untested**||\n|ruby||\n|rust||\n|rust-server||\n|scala||\n|scalatra||\n|scalaz|client|**Untested**||\n|**sinatra**|server|**Syntax checks OK**||\n|**slim**|server|**Untested**||\n|**swagger**|meta|*outputs the input definition (in original form if OpenAPI 2.0)* :white_check_mark:||\n|**swagger-static**|documentation|**tested** *template modified to include partials*||\n|swift||\n|swift3||\n|swift4||\n|tizen||\n|typescript-angular||\n|typescript-angularjs||\n|**typescript-axios**|client|**tested**||jaredpalmer|\n|typescript-aurelia||\n|**typescript-fetch**|client|**compiles with tsc ok**||\n|typescript-jquery||\n|**typescript-node**|client|**compiles with tsc ok**||\n|undertow||\n|**validator**|meta|*uses swagger2openapi's OpenAPI 3.0 validator internally* :white_check_mark:||\n|ze-ph|\n\n### New Templates\n\nThese templates are examples of how features of OpenAPI Codegen may be used, and best-practices in naming model properties.\n\n|Template|Type|Status|README|Authors|Config Maintainer|\n|---|---|---|---|---|---|\n|testing.dredd|testing|**In progress**|[README](templates/testing.dredd/README.md.mustache)|@Mermade|@MikeRalphson|\n\u003c/details\u003e\n\n## Documentation\n\n* [See here](docs/README.md) - contributions welcome\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmermade%2Fopenapi-codegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmermade%2Fopenapi-codegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmermade%2Fopenapi-codegen/lists"}