{"id":25932756,"url":"https://github.com/cosium/openapi-annotation-processor","last_synced_at":"2025-03-04T00:39:05.702Z","repository":{"id":22795719,"uuid":"96917008","full_name":"Cosium/openapi-annotation-processor","owner":"Cosium","description":"A java annotation processor performing various operations related to OpenAPI \u0026 Swagger","archived":false,"fork":false,"pushed_at":"2022-12-16T13:44:20.000Z","size":144,"stargazers_count":6,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-25T20:41:19.828Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cosium.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-07-11T17:01:35.000Z","updated_at":"2024-05-20T08:41:50.000Z","dependencies_parsed_at":"2023-01-13T22:14:10.629Z","dependency_job_id":null,"html_url":"https://github.com/Cosium/openapi-annotation-processor","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cosium%2Fopenapi-annotation-processor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cosium%2Fopenapi-annotation-processor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cosium%2Fopenapi-annotation-processor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cosium%2Fopenapi-annotation-processor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cosium","download_url":"https://codeload.github.com/Cosium/openapi-annotation-processor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241763757,"owners_count":20016161,"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":"2025-03-04T00:39:04.868Z","updated_at":"2025-03-04T00:39:05.681Z","avatar_url":"https://github.com/Cosium.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maven Central Latest](https://img.shields.io/maven-central/v/com.cosium.openapi/openapi-annotation-processor.svg)](https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.cosium.openapi%22%20AND%20a%3A%22openapi-annotation-processor%22)\n\n# OpenAPI Annotation Processor\nThe OpenAPI annotation processor parses Java source code and generates OpenAPI specification and optionally related code.\n\nIt currently supports `Spring MVC` and `Swagger 2.0`.\n\n### Why an annotation processor instead of a maven plugin?\nBecause it is natively supported by `javac`. Therefore, it will make your development workflow smoother. \n\n### How to use it\nAdd the maven dependency:\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.cosium.openapi\u003c/groupId\u003e\n    \u003cartifactId\u003eopenapi-annotation-processor\u003c/artifactId\u003e\n    \u003cversion\u003e1.25\u003c/version\u003e\n    \u003cscope\u003eprovided\u003c/scope\u003e\n\u003c/dependency\u003e\n```\nOptions can be passed to the annotation processor like this:\n```xml\n\u003cplugin\u003e\n\t\u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n\t\u003cartifactId\u003emaven-compiler-plugin\u003c/artifactId\u003e\n\t\u003cconfiguration\u003e\n\t\t\u003ccompilerArguments\u003e\n    \t\t\u003cAcom.cosium.openapi.code_generator.languages\u003etypescript-angular\u003c/Acom.cosium.openapi.code_generator.languages\u003e\n\t\t\u003c/compilerArguments\u003e\n\t\u003c/configuration\u003e\n\u003c/plugin\u003e\n```\nBy default, the processor will only generate specification in yaml and json formats.\n\nYou have to provide `languages` option to enable code generation.\n\nAll generated files will be available in the classes output folder.\n\n### Options\n##### Generation package\n- Key: `com.cosium.openapi.generation_package`\n- Default value: `com.cosium.openapi.generated`\n- Description: The package where generated files will be written\n##### Specification title\n- Key: `com.cosium.openapi.specification_generator.title`\n- Default value: ``\n- Description: The OpenAPI title\n##### Specification base path\n- Key: `com.cosium.openapi.specification_generator.base_path`\n- Default value: `/`\n- Description: The OpenAPI base path\n##### Specification global produces\n- Key: `com.cosium.openapi.specification_generator.produces`\n- Default value: `application/json`\n- Description: The OpenAPI global produces mime type\n##### Specification global consumes\n- Key: `com.cosium.openapi.specification_generator.consumes`\n- Default value: `application/json`\n- Description: The OpenAPI global consumes mime type\n##### Code generated languages\n- Key: `com.cosium.openapi.code_generator.languages`\n- Example of value: `typescript-angular,typescript-angular2`\n- Description: The languages to use to generate OpenAPI related code\n##### One code generation folder per language\n- Key: `com.cosium.openapi.code_generator.one_generation_folder_per_language`\n- Default: `true`\n- Description: True if each language code should be written in a separate folder named as the language. False to put all languages in the same folder.\n\n### Architecture\nThe processor calls the following components:\n1. One or more path parser\n2. One specification generator\n3. One code generator\n\n##### Path parser\n`PathParser` takes Java source code as input and returns a list of Swagger 2.0 API paths.\n\nThe following parsers are available out of the box:\n- `SpringParser` which parses your Spring MVC controllers\n\nMore parsers are expected to be added over time (JAX-RS, Servlet, ...)\n\n##### Specification generator\n`SpecificationGenerator` takes a list of Swagger 2.0 API paths as input and generates a full Swagger 2.0 specification.\n\n`DefaultSpecificationGenerator` takes care of this task. \nThis generator should remain the only implementation until Swagger 3.0 specification.\n\n##### Code generator\n`CodeGenerator` takes a full Swagger 2.0 specification as input and generates related code.\n\n`DefaultCodeGenerator` takes care of this task. It uses [swagger-codegen](https://github.com/swagger-api/swagger-codegen).\nThis generator should remain the only implementation until Swagger 3.0 specification.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosium%2Fopenapi-annotation-processor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosium%2Fopenapi-annotation-processor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosium%2Fopenapi-annotation-processor/lists"}