{"id":18889754,"url":"https://github.com/scottlogic/openapi-forge-java","last_synced_at":"2026-02-25T09:30:21.121Z","repository":{"id":148155261,"uuid":"586858955","full_name":"ScottLogic/openapi-forge-java","owner":"ScottLogic","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-25T08:25:27.000Z","size":394,"stargazers_count":1,"open_issues_count":10,"forks_count":0,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-01-31T19:39:52.645Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ScottLogic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-01-09T11:59:06.000Z","updated_at":"2023-03-24T15:50:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"f30a8b8f-14d7-4100-96af-22898eac5d19","html_url":"https://github.com/ScottLogic/openapi-forge-java","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScottLogic%2Fopenapi-forge-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScottLogic%2Fopenapi-forge-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScottLogic%2Fopenapi-forge-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScottLogic%2Fopenapi-forge-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ScottLogic","download_url":"https://codeload.github.com/ScottLogic/openapi-forge-java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239861079,"owners_count":19709151,"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-08T07:50:43.855Z","updated_at":"2026-02-25T09:30:21.061Z","avatar_url":"https://github.com/ScottLogic.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## OpenAPI Forge - Java\n\nThis repository is the Java generator for the [OpenAPI Forge](https://github.com/ScottLogic/openapi-forge), see that repository for usage instructions.\n\n## Configuration\n\nOpenAPI Forge is opinionated in its approach, we don't provide a vast range of configuration options, just the essentials! You can list the generator-specific configuration options by running the `generate-options` command as follows:\n\n```\n% openapi-forge generator-options openapi-forge-java\nThis generator has a number of additional options which can be supplied when executing the 'forge' command.\n\nOptions:\n  --generator.package \u003cvalue\u003e  The package for the generated classes.\n```\n\n## Development\n\n### Running\n\nTo run this generator, you also need to have [OpenAPI Forge](https://github.com/ScottLogic/openapi-forge) installed, or the repository checked out. Assuming you have it installed as a global module, you can run this generator as follows:\n\n```\n$ openapi-forge forge\n \\ https://petstore3.swagger.io/api/v3/openapi.json\n \\ .\n \\ -o api\n```\n\nThis generates an API from the Pet Store swagger definition, using the generator within the current folder (`.`), outputting the results to the `api` folder.\n\nAfterwards, by modiyfing the `Application.java` in the generated `api` project, we can fetch every `available` pet and print them into stdout.\n\n```java\nimport java.util.List;\nimport java.util.stream.Collectors;\nimport okhttp3.OkHttpClient;\n\n// ..\npublic CommandLineRunner commandLineRunner(ApplicationContext ctx) {\n  return args -\u003e {\n    Configuration configuration = new Configuration();\n    configuration.basePath = \"https://petstore3.swagger.io\";\n    OkHttpClient client = new OkHttpClient();\n    ApiClientPet apiClientPet = new ApiClientPet(client, configuration);\n    HttpResponse\u003cList\u003cPet\u003e\u003e pets = apiClientPet.findPetsByStatus(\"available\");\n    System.out.println(pets.data.stream().map(x -\u003e x.getName()).collect(Collectors.toList()));\n  };\n}\n// ..\n\n```\n\n### Testing\n\nThe standard test script is used to execute the BDD-style tests against this generator.\n\n```\nnpm run test\n```\n\nThe script expects that the openapi-forge project (which is where the BDD feature files are located) is checked out at the same folder-level as this project. In-depth documentation can be found at [features/README.md](features/README.md).\n\n### Linting\n\nTwo scripts are available to help you find linting errors:\n\n```\nnpm run lint:check:all\n```\n\nThis runs eslint in check mode which will raise errors found but not try and fix them. This is also ran on a PR and a push to main. It will fail if any errors were found.\n\n```\nnpm run lint:write:all\n```\n\nThis runs eslint in write mode which will raise errors found and try to fix them.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottlogic%2Fopenapi-forge-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottlogic%2Fopenapi-forge-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottlogic%2Fopenapi-forge-java/lists"}