{"id":19544824,"url":"https://github.com/drewalth/openapi-generator","last_synced_at":"2026-05-05T01:39:38.078Z","repository":{"id":178712321,"uuid":"662252610","full_name":"drewalth/openapi-generator","owner":"drewalth","description":"Generate an OpenAPI Spec file from ORM model definitions","archived":false,"fork":false,"pushed_at":"2023-07-05T01:35:53.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-20T01:02:25.619Z","etag":null,"topics":["eloquent","generator","openapi","orm","sequelize","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Go","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/drewalth.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-04T17:40:38.000Z","updated_at":"2024-01-20T08:42:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"88a56a64-f3c2-4e19-a96b-30447766912b","html_url":"https://github.com/drewalth/openapi-generator","commit_stats":null,"previous_names":["drewalth/openapi-generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/drewalth/openapi-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewalth%2Fopenapi-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewalth%2Fopenapi-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewalth%2Fopenapi-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewalth%2Fopenapi-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drewalth","download_url":"https://codeload.github.com/drewalth/openapi-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewalth%2Fopenapi-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32632290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: 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":["eloquent","generator","openapi","orm","sequelize","spring-boot"],"created_at":"2024-11-11T03:32:15.438Z","updated_at":"2026-05-05T01:39:38.057Z","avatar_url":"https://github.com/drewalth.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAPI Specification Generator\n\nThis CLI tool generates an [OpenAPI Specification](https://swagger.io/specification/) from data models in a software project that uses an Object Relational\nMapper (ORM). The tool currently supports Laravel Eloquent (PHP), Sequelize (JavaScript), and Spring Boot (Java) ORMs.\n\n## Why?\n\nThe OpenAPI Specification is a powerful tool for documenting REST APIs. However, it can be tedious to write the\nspecification manually. This tool aims to jumpstart the process by generating a basic starting point for your \nAPI documentation journey.\n\nOnce you have an OpenAPI specification, you can use it to generate documentation, client SDKs, and server stubs using\nthe [OpenAPI Generator](https://openapi-generator.tech/).\n\n## Prerequisites\n\n- Go 1.13 or higher\n\n## Installation\n\n1. Clone this repository:\n\n```bash\ngit clone https://github.com/drewalth/openapi-generator.git\n```\n\n2. Navigate to the cloned repository:\n\n```bash\ncd openapi-generator\n```\n\n3. Run setup script. This will install project dependencies and configure git hooks.\n\n```bash\nmake setup\n```\n\n## Usage\n\nTo run the script, execute the following command in your terminal:\n\n```bash\ngo run *.go --path /path/to/models --orm ORMName\n```\n\n- Replace `/path/to/models` with the path to the directory containing the models of your project.\n- Replace `ORMName` with one of the supported ORMs (`Eloquent`, `Sequelize`, or `SpringBoot`).\n\nThis will generate an OpenAPI specification in YAML format in a directory called `openapi` in the current working\ndirectory.\n\n## How It Works\n\n1. The tool takes in the path to the directory containing your data models and the name of the ORM you are using as\n   command line arguments.\n2. It parses the data models in the specified directory. Parsing involves reading the files and extracting information\n   such as class names and properties. Note that the parsing logic in this example is rudimentary and serves for\n   illustration purposes.\n3. The extracted information is used to generate a basic OpenAPI Specification in YAML format with CRUD endpoints (List,\n   Create, Retrieve by ID, Update, Delete) for each model.\n4. The generated specification is saved in an \"openapi\" directory in the current working directory.\n\n## Limitations and Improvements\n\n- The parsing logic is very basic and might not cover all cases.\n- The type mappings from model properties to OpenAPI types are not handled; need to add logic to map the types\n  correctly.\n- The generated OpenAPI specification is very basic; in a real-world scenario, the specification could be much more\n  detailed and complex.\n- Error handling should be improved for production usage.\n- This is just a starting point and you will need to build upon this to handle various cases (relationships, validation\n  rules, etc.). This will only handle basic property types, and won't account for complex structures and relationships.\n- Properly parsing PHP source code is a difficult task. Might want to look into using a PHP parser that can be called\n  from Go.\n- Consider using a more robust method for parsing Sequelize models such as writing a script in JavaScript or TypeScript\n  that uses the abstract syntax tree (AST) for parsing.\n\n## Contributing\n\nContributions to improve the functionality and robustness of this tool are welcome. Please feel free to open issues or\nsubmit pull requests.\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrewalth%2Fopenapi-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrewalth%2Fopenapi-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrewalth%2Fopenapi-generator/lists"}