{"id":15024563,"url":"https://github.com/apiaddicts/apigen.springboot","last_synced_at":"2026-02-04T22:20:17.483Z","repository":{"id":48560007,"uuid":"317847354","full_name":"apiaddicts/apigen.springboot","owner":"apiaddicts","description":"Apigen allow generate springboot archetipe using openapi file as mapping tool between the openapi definition and the database.","archived":false,"fork":false,"pushed_at":"2025-12-01T17:24:54.000Z","size":758,"stargazers_count":28,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-29T21:35:35.109Z","etag":null,"topics":["java","microservices","openapi3","openapi31","springboot"],"latest_commit_sha":null,"homepage":"https://www.apiaddicts.org/apitools/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apiaddicts.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-12-02T11:56:38.000Z","updated_at":"2025-12-01T17:12:28.000Z","dependencies_parsed_at":"2024-01-16T20:39:50.219Z","dependency_job_id":"6ad7da9e-f96b-48fb-ab1f-7326721bdce8","html_url":"https://github.com/apiaddicts/apigen.springboot","commit_stats":{"total_commits":61,"total_committers":7,"mean_commits":8.714285714285714,"dds":"0.47540983606557374","last_synced_commit":"09b62c40029a99ce49a131ea7a48530890902ad2"},"previous_names":["apiaddicts/apigen"],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/apiaddicts/apigen.springboot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiaddicts%2Fapigen.springboot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiaddicts%2Fapigen.springboot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiaddicts%2Fapigen.springboot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiaddicts%2Fapigen.springboot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apiaddicts","download_url":"https://codeload.github.com/apiaddicts/apigen.springboot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apiaddicts%2Fapigen.springboot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28647590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["java","microservices","openapi3","openapi31","springboot"],"created_at":"2024-09-24T20:00:32.936Z","updated_at":"2026-02-04T22:20:17.463Z","avatar_url":"https://github.com/apiaddicts.png","language":"Java","readme":"\n# 🛠️ Apigen ![Release](https://img.shields.io/badge/release-2.0.2-purple) ![Swagger](https://img.shields.io/badge/-openapi-%23Clojure?style=flat\u0026logo=swagger\u0026logoColor=white) ![Java](https://img.shields.io/badge/java-%23ED8B00.svg?style=flat\u0026logo=openjdk\u0026logoColor=white) ![Spring](https://img.shields.io/badge/spring-%236DB33F.svg?style=flat\u0026logo=spring\u0026logoColor=white) [![License: LGPL v3](https://img.shields.io/badge/license-LGPL_v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)\n\nWelcome to **apigen.springboot**, made in spain ![Spain](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/es.png \"Spain\"), the opensource project in Java that allows you to generate an archetype of the springboot framework using the openapi file as a mapping tool between the openapi definition and the database. Click maven to see available mvnrepository dependencies.\n\n\u003ca title=\"mvnrepository\" href=\"https://mvnrepository.com/artifact/org.apiaddicts.apitools.apigen/apigen\"\u003e\n    \u003cimg width=\"150\"  src=\"https://blog.irontec.com/wp-content/uploads/2019/12/1280px-Maven_logo.svg_-300x76.png\"\u003e\n\u003c/a\u003e\n\n### This repository is intended for :octocat: **community** use, it can be modified and adapted without commercial use. If you need a version, support or help for your **enterprise** or project, please contact us 📧 devrel@apiaddicts.org\n\n[![Twitter](https://img.shields.io/badge/Twitter-%23000000.svg?style=for-the-badge\u0026logo=x\u0026logoColor=white)](https://twitter.com/APIAddicts)\n[![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?style=for-the-badge\u0026logo=discord\u0026logoColor=white)](https://discord.gg/ZdbGqMBYy8)\n[![LinkedIn](https://img.shields.io/badge/linkedin-%230077B5.svg?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white)](https://www.linkedin.com/company/apiaddicts/)\n[![Facebook](https://img.shields.io/badge/Facebook-%231877F2.svg?style=for-the-badge\u0026logo=Facebook\u0026logoColor=white)](https://www.facebook.com/apiaddicts)\n[![YouTube](https://img.shields.io/badge/YouTube-%23FF0000.svg?style=for-the-badge\u0026logo=YouTube\u0026logoColor=white)](https://www.youtube.com/@APIAddictslmaoo)\n\n# 🙌 Join the **Apigen** Adopters list\n📢 If Apigen is part of your organization's toolkit, we kindly encourage you to include your company's name in our Adopters list. 🙏 This not only significantly boosts the project's visibility and reputation but also represents a small yet impactful way to give back to the project.\n\n| Organization  | Description of Use / Referenc |\n|---|---|\n|  [CloudAppi](https://cloudappi.net/)  | Apification and generation of microservices |\n| [Acciona](https://www.acciona.com/)  | Generation of microservices |\n| [Madrid Digital](https://www.comunidad.madrid/servicios/sede-electronica/madrid-digital/)  | Generation of microservices  |\n| [Apiquality](https://apiquality.io/)  | Generation of microservices  |\n\n# 👩🏽‍💻  Contribute to ApiAddicts\n\nWe're an inclusive and open community, welcoming you to join our effort to enhance ApiAddicts, and we're excited to prioritize tasks based on community input, inviting you to review and collaborate through our GitHub issue tracker.\n\nFeel free to drop by and greet us on our GitHub discussion or Discord chat. You can also show your support by giving us some GitHub stars ⭐️, or by following us on Twitter, LinkedIn, and subscribing to our YouTube channel! 🚀\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/apiaddicts)\n\n\n# 📑 Getting started\n\n## 🖥️ CLI\n\n```bash\njava -jar generator-cli.jar generate -f openapi.yaml -o ./code\n\njava -jar generator-cli.jar help\n```\n\n## 🐋 Docker compose\n\n```yaml\nversion: \"3.3\"\nservices:\n  apigen:\n    image: \"apiaddicts/apitools-apigen:2.0.2\"\n    ports:\n      - \"8080:8080\"\n```\n\n```bash\ncurl -X POST \"http://localhost:8080/generator/file\" \\\n  -F \"file=@openapi.yaml\"\n```\n\n## Project\n\n### Scheme\n    x-apigen-project:\n      name: string\n      description: string\n      version: string\n      java-properties:\n        group-id: string\n        artifact-id: string\n\n### Definition\n- `x-apigen-project`: Section where project information is defined\n  - `name`: Project name\n  - `description`: Brief project description\n  - `version`: Project version\n  - `java-properties`: Section where specific Java project information is defined\n    - `group-id`: Initial package name where the project resides. If it consists of multiple words, they will be separated by `.`\n    - `artifact-id`: Identifier name for the project\n    - `base-package`: Name of the base package to use in the generated code; if not specified, it is obtained from the `group-id` and `artifact-id`\n  - `standard-response-operations`: Section where standard apigen response transformation operations are defined (optional)\n    - `\u003cjsonpatch operation node\u003e`: Node that complies with the json-patch standard, allowing optional operations to be declared on all elements of an array\n\n### Samples\n    x-apigen-project:\n      name: Colors\n      description: This would be the Colors project\n      version: 1.0.0\n      java-properties:\n        group-id: the.group\n        artifact-id: app\n\n## Models\n\n### Scheme\n    x-apigen-models:\n      \u003cmodel_name\u003e:\n        relational-persistence:\n          table: string\n        attributes:\n          - name: string\n            type: string [ENUM[Array, String, Boolean, Double, Float, BigDecimal, Integer, Long, BigInteger, LocalDate, LocalDateTime, ZonedDateTime, OffsetDateTime, Instant, ComposedID] o \u003cmodel_name\u003e]\n            items-type: string [\u003cmodel_name\u003e]\n            relational-persistence:\n              column: string\n              primary-key: boolean\n              foreign-column: string\n              intermediate-table: string\n              owner: boolean\n            validations:\n              - type: string [ENUM[NotNull, Size, Min, Max, Email, NotEmpty, NotBlank, Positive, PositiveOrZero, Negative, NegativeOrZero, Past, PastOrPresent, Future, FutureOrPresent, Pattern, Digits, DecimalMin, DecimalMax]]\n                min: integer\n                max: integer\n                regex: string\n                value: integer | string\n                integer: integer\n                fraction: integer\n                inclusive: boolean   \n\n### Definition\n- `x-apigen-models`: Section where project models are defined\n  - `\u003cmodel_name\u003e`: Name of the model\n    - `relational-persistence`: Section where all aspects related to the model's relational persistence are indicated\n      - `table`: Name of the table in the database\n    - `attributes`: Section that contains the model's attributes\n      - `name`: Name of the attribute\n      - `type`: Type of the attribute, supported types are: [Array, String, Boolean, Double, Float, Integer, Long, LocalDate, OffsetDateTime, ComposedID], or in the case of another model, the name of that model\n      - `items-type`: In the case of the `type` being an `Array`, this field should be defined with the name of the referenced model\n      - `attributes`: Similar to the `attributes` of the model, only used when the `type` is ComposedID to indicate the attributes that make up the identifier\n      - `relational-persistence`: Section where all aspects related to the relational persistence of the model's attribute are indicated\n        - `column`: Name of the column in the database\n        - `columns`: Relationship of columns from the current table to another related table when dealing with a model with a composite identifier (each entry is defined as key: value where the key is the name in the current table and the value is the name in the related table)\n        - `primary-key`: Indicates if it is the primary key, if not specified, the default value will be `false`\n        - `foreign-column`: Indicates the name of the column in the related table\n        - `foreign-columns`: Relationship of columns in the related table to the current table when dealing with a model with a composite identifier (each entry is defined as key: value where the key is the name in the related table and the value is the name in the current table)\n        - `intermediate-table`: Name of the intermediate table in those attributes that represent a many-to-many relationship\n        - `owner`: Indicates if this part of the relationship is the owner, necessary in one-to-one or one-to-many relationships\n        - `sequence`: Section where the optional generator to use for the primary key can be indicated\n      - `validations`: Section where attribute validations are defined\n        - `type`: The supported types for validation are as follows: [NotNull, Size, Min, Max, Email, NotEmpty, NotBlank, Positive, PositiveOrZero, Negative, NegativeOrZero, Past, PastOrPresent, Future, FutureOrPresent, Pattern, Digits, DecimalMin, DecimalMax]\n        - `min`: Value used when the `type` field is `Size`\n        - `max`: Value used when the `type` field is `Size`\n        - `regex`: Value used when the `type` field is `Pattern`\n        - `value`: Value used when the `type` field is `Min`, `Max`, `DecimalMin`, or `DecimalMax`\n        - `integer`: Value used when the `type` field is `Digits`, representing the maximum number of digits in the integer part of the number\n        - `fraction`: Value used when the `type` field is `Digits`, representing the maximum number of digits in the decimal part of the number\n        - `inclusive`: Value used when the `type` field is `DecimalMin` or `DecimalMax`\n\n### Samples\n    x-apigen-models:\n      Color:\n        relational-persistence:\n          table: colors\n        attributes:\n          - name: id\n            type: Long\n            relational-persistence:\n              column: id\n              primary-key: true\n            validations:\n              - type: NotNull\n          - name: name\n            type: String\n            relational-persistence:\n              column: name\n            validations:\n              - type: Pattern\n                regex: [A-Z]+\n      Composed:\n        relational-persistence:\n          table: composed\n        attributres:\n          - name: id\n            type: ComposedID\n            validations:\n               - type: NotNull\n            attributes:\n              - name: one\n                type: String\n                relational-persistence:\n                  column: c_one\n                validations:\n                 - type: NotNull\n              - name: two\n                type: Integer      \n                relational-persistence:\n                  column: c_two      \n                validations:\n                 - type: NotNull\n\n## Path expansion\n\n### Scheme\n    paths:\n      \u003cpath\u003e:\n        ...\n        x-apigen-binding:\n          model: string\n\n### Definition\n- `x-apigen-binding`: Section where the connection between the endpoint and the model we will use is defined\n  - `model`: In this field, we can specify the name of the model.\n  - `child-model`: In this field, we will put the name of the child model. Only necessary for self-managed endpoints of parent-child type entities.\n  - `child-parent-relation-property`: In this field, we will put the name of the property in the child that relates to the parent. Only necessary for self-managed endpoints of parent-child type entities.\n\n### Sample\n    paths:\n      /colors:\n        x-apigen-binding:\n          model: Color\n\n## Extension of the schema section of the requestBody\n\n### Scheme\n\n    schemas:\n      \u003cschema\u003e:\n        x-apigen-mapping:\n          model: string\n      type: object\n      properties:\n        \u003cprop_name\u003e:\n          type: string\n          x-apigen-mapping:\n            model: string\n            field: string\n        \u003cprop_name_2\u003e:\n          x-apigen-mapping:\n            model: string\n\n### Definition\n\n- `x-apigen-mapping`: Section where all mapping data between resources and models are defined. Each attribute of an input resource, including the input resource itself, can have this section defined. If it is not defined, it is assumed to have the default values indicated in each section.\n  - `model`: Name of the model that the resource or attribute represents. If not specified at the resource level, it is not considered a standard input resource.\n  - `field`: Name of the model attribute to which the resource attribute will be mapped. By default, if nothing is specified, it will be mapped to an attribute with the same name if it exists; otherwise, it will be ignored. There are two specific cases in which it is mandatory to define this field:\n    - When the name of the attribute in the resource and in the model are different:\n      ```yaml\n      nombre:\n        type: string\n        x-apigen-mapping:\n          field: primerNombre\n      ```\n    - When the attribute in the resource is an abbreviation of the identifier of a nested model:\n      ```yaml\n      color:\n        type: string\n        x-apigen-mapping:\n          model: color\n          field: valorCromatico.id\n      ```\n\n## Expansion of the response outline section\n\n### Preconditions\n\nThe Apigen extension for OpenAPI forces us to take into account a series of conditions so that endpoint responses comply with the standard.\n\n#### Have a defined standard response\n\n````yaml\n  schemas:\n    standard_response_result:\n      properties:\n        result:\n          type: object\n          properties:\n            status:\n              type: boolean\n            http_code:\n              type: integer\n            errors:\n              type: array\n              items:\n                $ref: '#/components/schemas/standard_error'\n            info:\n              type: string\n            trace_id:\n              type: string\n            num_elements:\n              type: integer\n          required:\n            - status\n            - http_code\n            - trace_id\n    standard_error:\n      type: object\n      properties:\n        code:\n          type: integer\n        message:\n          type: string\n````\n\n#### Have a single standard collection response defined for each model\n\n````yaml\n  schemas:\n    standard_response_collection_\u003cmodel\u003e:\n      allOf:\n        - $ref: \"#/components/schemas/standard_response_result\"\n        - type: object\n          properties:\n            data:\n              type: object\n              properties:\n                \u003cmodel_plural\u003e:\n                  type: array\n                  items:\n                    $ref: \"#/components/schemas/\u003cmodel_resource\u003e\"\n````\n\n#### Have a single simple standard response defined for each model\n\n````yaml\n  schemas:\n    standard_response_\u003cmodel\u003e:\n      allOf:\n        - $ref: \"#/components/schemas/standard_response_result\"\n        - type: object\n          properties:\n            data:\n              $ref: \"#/components/schemas/\u003cmodel_resource\u003e\"\n````\n\n### Scheme\n\n    schemas:\n      \u003cschema\u003e:\n        x-apigen-mapping:\n          model: string\n      type: object\n      properties:\n        \u003cprop_name\u003e:\n          type: string\n          x-apigen-mapping:\n            field: string\n\n### Definition\n- `x-apigen-mapping`: Section where all mapping data between resources and models are defined. Each output resource must have this section defined.\n  - `model`: Name of the model that the resource represents.\n  - `field`: Name of the model attribute to which the resource attribute will be mapped.\n\n### Sample\n\n    color:\n      x-apigen-mapping:\n        model: Color\n      type: object\n      properties:\n        json_id:\n          type: integer\n          x-apigen-mapping:\n            field: id\n        name:\n          type: string\n        forms:\n          $ref: \"#/components/schemas/forms\"\n\n\n## 💛 Sponsors\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://apiaddicts.org/\"\u003e\n    \t\u003cimg src=\"https://apiaddicts.cloudappi.net/web/image/4248/LOGOCloudappi2020Versiones-01.png\" alt=\"cloudappi\" width=\"150\"/\u003e\n        \u003cimg src=\"https://www.comunidad.madrid/sites/default/files/styles/block_teaser_image/public/img/logos-simbolos/logo_centrado_md.png?itok=4rTUhmcj\" alt=\"md\" width=\"150\"/\u003e\n        \u003cimg src=\"https://apiquality.io/wp-content/uploads/2022/09/cropped-logo-apiquality-principal-1-170x70.png\" height = \"75\"\u003e\n        \u003cimg src=\"https://apiaddicts-web.s3.eu-west-1.amazonaws.com/wp-content/uploads/2022/03/17155736/cropped-APIAddicts-logotipo_rojo.png\" height = \"75\"\u003e\n\t\u003c/a\u003e\n\u003c/p\u003e","funding_links":["https://www.buymeacoffee.com/apiaddicts"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapiaddicts%2Fapigen.springboot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapiaddicts%2Fapigen.springboot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapiaddicts%2Fapigen.springboot/lists"}