{"id":50993335,"url":"https://github.com/bigmoves/honk","last_synced_at":"2026-06-20T05:34:28.465Z","repository":{"id":324466460,"uuid":"1097327733","full_name":"bigmoves/honk","owner":"bigmoves","description":"An ATProto Lexicon validator for Gleam.","archived":false,"fork":false,"pushed_at":"2025-12-16T05:17:26.000Z","size":214,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-18T19:10:44.179Z","etag":null,"topics":["atprotocol","gleam","validation"],"latest_commit_sha":null,"homepage":"","language":"Gleam","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bigmoves.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":"2025-11-16T00:35:37.000Z","updated_at":"2026-01-16T22:18:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bigmoves/honk","commit_stats":null,"previous_names":["bigmoves/honk"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/bigmoves/honk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmoves%2Fhonk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmoves%2Fhonk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmoves%2Fhonk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmoves%2Fhonk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigmoves","download_url":"https://codeload.github.com/bigmoves/honk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigmoves%2Fhonk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34558894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["atprotocol","gleam","validation"],"created_at":"2026-06-20T05:34:27.562Z","updated_at":"2026-06-20T05:34:28.457Z","avatar_url":"https://github.com/bigmoves.png","language":"Gleam","funding_links":[],"categories":[],"sub_categories":[],"readme":"# honk\n\n[![Package Version](https://img.shields.io/hexpm/v/honk)](https://hex.pm/packages/honk)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/honk/)\n\nAn [AT Protocol](https://atproto.com/) Lexicon validator for Gleam.\n\n\u003e [!WARNING]\n\u003e While I've tried to be as thorough as possible checking the validators against various atproto\n\u003e validation libraries, this may contain bugs. Please report any issues you find.\n\n## Installation\n\n```sh\ngleam add honk@1\n```\n\n## Quick Start\n\n### Validate a Lexicon Schema\n\n```gleam\nimport honk\nimport gleam/json\n\npub fn main() {\n  let lexicon = json.object([\n    #(\"lexicon\", json.int(1)),\n    #(\"id\", json.string(\"xyz.statusphere.status\")),\n    #(\"defs\", json.object([\n      #(\"main\", json.object([\n        #(\"type\", json.string(\"record\")),\n        #(\"key\", json.string(\"tid\")),\n        #(\"record\", json.object([\n          #(\"type\", json.string(\"object\")),\n          #(\"required\", json.preprocessed_array([\n            json.string(\"status\"),\n            json.string(\"createdAt\"),\n          ])),\n          #(\"properties\", json.object([\n            #(\"status\", json.object([\n              #(\"type\", json.string(\"string\")),\n              #(\"minLength\", json.int(1)),\n              #(\"maxGraphemes\", json.int(1)),\n              #(\"maxLength\", json.int(32)),\n            ])),\n            #(\"createdAt\", json.object([\n              #(\"type\", json.string(\"string\")),\n              #(\"format\", json.string(\"datetime\")),\n            ])),\n          ])),\n        ])),\n      ])),\n    ])),\n  ])\n\n  case honk.validate([lexicon]) {\n    Ok(_) -\u003e io.println(\"✓ Lexicon is valid\")\n    Error(err) -\u003e io.println(\"✗ Validation failed: \" \u003c\u003e err.message)\n  }\n}\n```\n\n### Validate Record Data\n\n```gleam\nimport honk\nimport gleam/json\n\npub fn validate_status() {\n  let lexicons = [my_lexicon] // Your lexicon definitions\n  let record_data = json.object([\n    #(\"status\", json.string(\"👍\")),\n    #(\"createdAt\", json.string(\"2025-01-15T12:00:00Z\")),\n  ])\n\n  case honk.validate_record(lexicons, \"xyz.statusphere.status\", record_data) {\n    Ok(_) -\u003e io.println(\"✓ Record is valid\")\n    Error(err) -\u003e io.println(\"✗ Invalid: \" \u003c\u003e err.message)\n  }\n}\n```\n\n## Features\n\n- **Type Validators**: string, integer, boolean, bytes, blob, cid-link, null, object, array, union, ref, record, query, procedure, subscription, token, unknown\n- **String Format Validators**: datetime (RFC3339), uri, at-uri, did, handle, at-identifier, nsid, cid, language, tid, record-key\n- **Constraint Validation**: length limits, ranges, enums, required fields\n- **Reference Resolution**: local (`#def`), global (`nsid#def`), and cross-lexicon references\n- **Detailed Error Messages**: validation errors with path information\n\n## CLI Usage\n\nValidate lexicon files from the command line:\n\n```sh\n# Validate a single file\ngleam run -m honk check ./lexicons/xyz/statusphere/status.json\n\n# Validate all .json files in a directory\ngleam run -m honk check ./lexicons/\n\n# Show help\ngleam run -m honk help\n```\n\nWhen validating a directory, all lexicons are loaded together to resolve cross-lexicon references\n\n## Testing\n\n```sh\ngleam test\n```\n\n## Documentation\n\nFurther documentation can be found at \u003chttps://hexdocs.pm/honk\u003e.\n\n## Development\n\n```sh\ngleam run   # Run the project\ngleam test  # Run the tests\ngleam build # Build the project\n```\n\n## License\n\nApache 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigmoves%2Fhonk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigmoves%2Fhonk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigmoves%2Fhonk/lists"}