{"id":25423268,"url":"https://github.com/gibahjoe/openapi-generator-dart","last_synced_at":"2025-04-12T14:55:53.918Z","repository":{"id":37958076,"uuid":"244850291","full_name":"gibahjoe/openapi-generator-dart","owner":"gibahjoe","description":"Openapi Generator for Dart/Flutter","archived":false,"fork":false,"pushed_at":"2025-03-07T19:25:26.000Z","size":90426,"stargazers_count":144,"open_issues_count":28,"forks_count":36,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T07:27:13.370Z","etag":null,"topics":["dart","flutter","openapi-client-sdk","openapi-generator"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gibahjoe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["buymeacoffee.com/gibahjoe"]}},"created_at":"2020-03-04T08:47:38.000Z","updated_at":"2025-03-27T22:08:04.000Z","dependencies_parsed_at":"2024-06-19T02:42:09.120Z","dependency_job_id":"442445c2-b30c-4a85-9471-dbf5423c0d4e","html_url":"https://github.com/gibahjoe/openapi-generator-dart","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gibahjoe%2Fopenapi-generator-dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gibahjoe%2Fopenapi-generator-dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gibahjoe%2Fopenapi-generator-dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gibahjoe%2Fopenapi-generator-dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gibahjoe","download_url":"https://codeload.github.com/gibahjoe/openapi-generator-dart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586245,"owners_count":21128996,"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":["dart","flutter","openapi-client-sdk","openapi-generator"],"created_at":"2025-02-16T22:27:07.696Z","updated_at":"2025-04-12T14:55:53.899Z","avatar_url":"https://github.com/gibahjoe.png","language":"Dart","funding_links":["buymeacoffee.com/gibahjoe","https://www.buymeacoffee.com/gibahjoe"],"categories":["Dart"],"sub_categories":[],"readme":"![pub package](https://img.shields.io/pub/v/openapi_generator.svg) ![Pub Likes](https://img.shields.io/pub/likes/openapi_generator?) ![Pub Points](https://img.shields.io/pub/points/openapi_generator) ![Pub Popularity](https://img.shields.io/pub/popularity/openapi_generator) ![GitHub Repo stars](https://img.shields.io/github/stars/gibahjoe/openapi-generator-dart)\n[![codecov](https://codecov.io/gh/gibahjoe/openapi-generator-dart/graph/badge.svg?token=MF8SDQJMGP)](https://codecov.io/gh/gibahjoe/openapi-generator-dart)\n\n### Like this library? Give us a star or a like.\n\nThis codebase houses the dart/flutter implementations of the openapi client sdk code generation libraries.\n\n## TOC\n\n- [Introduction](#introduction)\n- [Usage](#usage)\n- [NextGen](#next-generation)\n- [Features \u0026 Bugs](#features-and-bugs)\n\n## Introduction\n\nWith this project, you can generate client libraries from your openapi specification right in your\nflutter/dart projects (see example). This library was inspired by the npm\ncounterpart [Openapi Generator Cli](https://www.npmjs.com/package/@openapitools/openapi-generator-cli)\n\n[license](https://github.com/gibahjoe/openapi-generator-dart/blob/master/openapi-generator-annotations/LICENSE).\n\nThis repo contains the following dart libraries\n\n| Library                       | Description                                                                                                                                                            | latest version                                                                                                               |\n|-------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| openapi-generator             | Dev dependency for generating openapi client sdk via dart source gen [see here for usage](https://pub.dev/packages/openapi_generator)                                  | [![pub package](https://img.shields.io/pub/v/openapi_generator.svg)](https://pub.dev/packages/openapi_generator)             |\n| openapi-generator-annotations | Annotations for annotating dart class with instructions for generating openapi client sdk [see here for usage](https://pub.dev/packages/openapi_generator_annotations) | [![pub package](https://img.shields.io/pub/v/openapi_generator_annotations.svg)](https://pub.dev/packages/openapi_generator) |\n| openapi-generator-cli         | CLI only generator.  [see here for usage](https://pub.dev/packages/openapi_generator_cli)                                                                              | [![pub package](https://img.shields.io/pub/v/openapi_generator_cli.svg)](https://pub.dev/packages/openapi_generator_cli)     |\n\n## Usage\n\nInclude [openapi-generator-annotations](https://pub.dev/packages/openapi_generator_annotations) as a dependency in the\ndependencies section of your pubspec.yaml file :\n\n```yaml\ndependencies:\n  openapi_generator_annotations: ^[latest-version]\n```\n\nFor testing out the beta features in openapi generator, use the beta branch like below. This is not recommended for\nproduction builds\n\n```yaml\ndependencies:\n  openapi_generator_annotations:\n    git:\n      url: https://github.com/gibahjoe/openapi-generator-dart.git\n      ref: beta\n      path: openapi-generator-annotations\n```\n\nAdd [openapi-generator](https://pub.dev/packages/openapi_generator) in the dev dependencies section of your pubspec.yaml\nfile:\n\n```yaml\ndev_dependencies:\n  openapi_generator: ^[latest version]\n```\n\nFor testing out the beta features in openapi generator, use the beta branch like below. This is not recommended for\nproduction builds\n\n```yaml\ndev_dependencies:\n  openapi_generator:\n    git:\n      url: https://github.com/gibahjoe/openapi-generator-dart.git\n      ref: beta\n      path: openapi-generator\n```\n\nAnnotate a dart class with @Openapi() annotation\n\n```dart\n@Openapi(\n  additionalProperties:\n  DioProperties(pubName: 'petstore_api', pubAuthor: 'Johnny dep..'),\n  inputSpec:\n  RemoteSpec(path: 'https://petstore3.swagger.io/api/v3/openapi.json'),\n  typeMappings: {'Pet': 'ExamplePet'},\n  generatorName: Generator.dio,\n  runSourceGenOnOutput: true,\n  outputDirectory: 'api/petstore_api',\n)\n```\n\nRun\n\n```shell\ndart run build_runner build --delete-conflicting-outputs\n```\n\nor\n\n```shell\nflutter pub run build_runner build --delete-conflicting-outputs\n```\n\nto generate open api client sdk from spec file specified in annotation.\nThe api sdk will be generated in the folder specified in the annotation. See examples for more details\n\n## Next Generation\n\nAs of version 5.0 of this library, there is some new functionality slated to be added to the generator. This version\nwill have the ability to:\n\n- cache changes in the OAS spec\n- Rerun when there ares difference in the cached copy and current copy\n- Pull from a remote source and cache that.\n    - **Note**: This means that your cache could be potentially stale. But in that case this flow will still pull the\n      latest and run.\n    - While this is a possible usage, if you are actively developing your spec it is preferred you provide a local copy.\n- Skip generation based off:\n    - Flags\n    - No difference between the cache and local\n- And all the functionality provided previously.\n\nYour original workflow stay the same but there is a slight difference in the annotations.\n\nNew:\n\n```dart\n@Openapi(\n  additionalProperties:\n  DioProperties(pubName: 'petstore_api', pubAuthor: 'Johnny dep..'),\n  inputSpec:\n  RemoteSpec(path: 'https://petstore3.swagger.io/api/v3/openapi.json'),\n  typeMappings: {'Pet': 'ExamplePet'},\n  generatorName: Generator.dio,\n  runSourceGenOnOutput: true,\n  outputDirectory: 'api/petstore_api',\n)\nclass Example {}\n```\n\n## Known Issues\n\nCheck out the known issues article here [Known Issues](openapi-generator-annotations/README.md#known-issues)\n\n## Contributing\n\nAll contributions are welcome. Please ensure to read through our [contributing guidelines](CONTRIBUTING.md) before\nsending your PRs.\n\n## Features and bugs\n\nPlease file feature requests and bugs at the [issue tracker][tracker].\n\n[tracker]: https://github.com/gibahjoe/openapi-generator-dart/issues\n\n\u003ca href=\"https://www.buymeacoffee.com/gibahjoe\" target=\"_blank\"\u003e\u003cimg src=\"https://bmc-cdn.nyc3.digitaloceanspaces.com/BMC-button-images/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: auto !important;width: auto !important;\" \u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgibahjoe%2Fopenapi-generator-dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgibahjoe%2Fopenapi-generator-dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgibahjoe%2Fopenapi-generator-dart/lists"}