{"id":32272802,"url":"https://github.com/florianpallas/hgen","last_synced_at":"2026-02-21T08:02:15.003Z","repository":{"id":238600023,"uuid":"796474164","full_name":"FlorianPallas/hgen","owner":"FlorianPallas","description":"API Schema Language for Humans","archived":false,"fork":false,"pushed_at":"2024-08-15T00:51:57.000Z","size":103,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-27T17:09:46.129Z","etag":null,"topics":["api","codegen","dart","generator","reflection","rpc","rust","schema","serialization","typescript"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/FlorianPallas.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}},"created_at":"2024-05-06T02:30:23.000Z","updated_at":"2025-09-15T12:10:45.000Z","dependencies_parsed_at":"2024-06-07T18:43:10.824Z","dependency_job_id":"1c38618f-f4d7-4a7c-91af-16ec78007b8e","html_url":"https://github.com/FlorianPallas/hgen","commit_stats":null,"previous_names":["florianpallas/hgen"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/FlorianPallas/hgen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianPallas%2Fhgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianPallas%2Fhgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianPallas%2Fhgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianPallas%2Fhgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FlorianPallas","download_url":"https://codeload.github.com/FlorianPallas/hgen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlorianPallas%2Fhgen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29676981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["api","codegen","dart","generator","reflection","rpc","rust","schema","serialization","typescript"],"created_at":"2025-10-22T23:07:56.870Z","updated_at":"2026-02-21T08:02:14.997Z","avatar_url":"https://github.com/FlorianPallas.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hGEN\n\n\u003e API Schema Language for Humans\n\n\u003e [!WARNING]  \n\u003e This project is in early development and not ready for production use.\n\n## Usage\n\nThe hGEN CLI can be used to generate code for a given schema file.\n\n```bash\n$ cargo install hgen\n$ hgen -i schema.hgen -o schema.ts\n```\n\n## Philosophy\n\n- **Single Source of Truth**: Making sure that your API is consistent across all your services and clients is hard. With hGEN, you define and maintain your API in a single place, while fast code generation keeps overhead low.\n\n- **Strict by Design**: What is the point of a schema language if it doesn't enforce strict rules? hGEN is heavily inspired by Rust's type system, making sure that your API is as safe as possible.\n\n- **Compile Time Reflection**: Since code generated files are not meant to be edited directly, hGEN gives you that power back in form of an easy to use and strongly typed reflection metadata format, allowing you to build upon the generated code to implement you own types, validation, mapping logic and more.\n\n- **Scalable Metadata**: Other schema or reflection methods require lots of ugly annotations and lack type safety. This is why one goal of hGEN is to provide a scalable way of defining metadata directly in the schema, allowing you to define validation, serialization and more in a type-safe way without taking away from the readability of the schema.\n\n## Schema Language\n\nhGEN defines its own schema language to describe APIs. The language is heavily inspired by languages like TypeScript, Kotlin and Dart, making it easy to learn and use. hGEN primitive types are based on Rust however, pushing for a more strict and safe API design.\n\n```\nextern alias Instant = String;\n\nalias UUID = String \u0026 {\n  type: uuid,\n};\n\nstruct Todo {\n  id: UUID,\n  title: String,\n  createdAt: Instant,\n  checkedAt: Instant?,\n}\n\nstruct CreateTodoParams {\n  title: String,\n}\n\nservice TodoService {\n  create(params: CreateTodoParams) -\u003e Todo,\n  find() -\u003e List\u003cTodo\u003e,\n  check(id: UUID) -\u003e Unit,\n  uncheck(id: UUID) -\u003e Unit,\n}\n```\n\n## Reference\n\n### Types\n\n- Primitives:\n\n  - [x] `Struct`\n  - [x] `Enum`\n  - [x] `Bool`\n  - [x] `Int8`, `Int16`, `Int32`, `Int64`, `Int128`\n  - [ ] `UInt8`, `UInt16`, `UInt32`, `UInt64`, `UInt128`\n  - [x] `Float32`, `Float64`\n  - [ ] `Char`\n  - [x] `String`\n  - [x] `Nullable`\n  - [x] `Unit`\n  - [ ] `(T1, T2, ..., Tn)`\n  - [x] `List\u003cT\u003e`\n  - [x] `Map\u003cK, V\u003e`\n  - [ ] `Union`\n\n- Concepts:\n\n  - [x] Type Alias\n  - [x] Custom Type\n  - [ ] Result Type\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorianpallas%2Fhgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflorianpallas%2Fhgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflorianpallas%2Fhgen/lists"}