{"id":20687205,"url":"https://github.com/socialweb-php/atproto-lexicon","last_synced_at":"2025-04-22T15:08:11.995Z","repository":{"id":159628062,"uuid":"634744534","full_name":"socialweb-php/atproto-lexicon","owner":"socialweb-php","description":"A PHP-based Lexicon parser for applications using the AT Protocol","archived":false,"fork":false,"pushed_at":"2024-05-01T22:07:03.000Z","size":276,"stargazers_count":10,"open_issues_count":5,"forks_count":5,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-22T15:08:11.262Z","etag":null,"topics":["atp","atprotocol","bluesky","lexicon"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/socialweb-php.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"COPYING","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"ramsey"}},"created_at":"2023-05-01T04:22:36.000Z","updated_at":"2025-04-22T13:04:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"29aa7ea4-6296-4f00-b05e-c6e2479f04e8","html_url":"https://github.com/socialweb-php/atproto-lexicon","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socialweb-php%2Fatproto-lexicon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socialweb-php%2Fatproto-lexicon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socialweb-php%2Fatproto-lexicon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socialweb-php%2Fatproto-lexicon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/socialweb-php","download_url":"https://codeload.github.com/socialweb-php/atproto-lexicon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250264910,"owners_count":21402003,"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":["atp","atprotocol","bluesky","lexicon"],"created_at":"2024-11-16T22:56:25.820Z","updated_at":"2025-04-22T15:08:11.972Z","avatar_url":"https://github.com/socialweb-php.png","language":"PHP","funding_links":["https://github.com/sponsors/ramsey"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003esocialweb/atproto-lexicon\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cstrong\u003eA PHP-based Lexicon parser for applications using the AT Protocol\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/socialweb-php/atproto-lexicon\"\u003e\u003cimg src=\"https://img.shields.io/badge/source-socialweb/atproto--lexicon-blue.svg?style=flat-square\" alt=\"Source Code\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://packagist.org/packages/socialweb/atproto-lexicon\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/socialweb/atproto-lexicon.svg?style=flat-square\u0026label=release\" alt=\"Download Package\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://php.net\"\u003e\u003cimg src=\"https://img.shields.io/packagist/php-v/socialweb/atproto-lexicon.svg?style=flat-square\u0026colorB=%238892BF\" alt=\"PHP Programming Language\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/socialweb-php/atproto-lexicon/blob/main/NOTICE\"\u003e\u003cimg src=\"https://img.shields.io/packagist/l/socialweb/atproto-lexicon.svg?style=flat-square\u0026colorB=darkcyan\" alt=\"Read License\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/socialweb-php/atproto-lexicon/actions/workflows/continuous-integration.yml\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/socialweb-php/atproto-lexicon/continuous-integration.yml?branch=main\u0026style=flat-square\u0026logo=github\" alt=\"Build Status\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://codecov.io/gh/socialweb-php/atproto-lexicon\"\u003e\u003cimg src=\"https://img.shields.io/codecov/c/gh/socialweb-php/atproto-lexicon?label=codecov\u0026logo=codecov\u0026style=flat-square\" alt=\"Codecov Code Coverage\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://shepherd.dev/github/socialweb-php/atproto-lexicon\"\u003e\u003cimg src=\"https://img.shields.io/endpoint?style=flat-square\u0026url=https%3A%2F%2Fshepherd.dev%2Fgithub%2Fsocialweb-php%2Fatproto-lexicon%2Fcoverage\" alt=\"Psalm Type Coverage\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## About\n\nsocialweb/atproto-lexicon parses [Lexicon schemas][] for the [AT Protocol][].\n\nThe current version is compliant with [@atproto/lexicon][] at commit-ish\n[a900e95][].\n\nThis project adheres to a [code of conduct](CODE_OF_CONDUCT.md).\nBy participating in this project and its community, you are expected to\nuphold this code.\n\n## Installation\n\nInstall this package as a dependency using [Composer](https://getcomposer.org).\n\n``` bash\ncomposer require socialweb/atproto-lexicon\n```\n\n## Usage\n\n```php\nuse SocialWeb\\Atproto\\Lexicon\\Nsid\\Nsid;\nuse SocialWeb\\Atproto\\Lexicon\\Parser\\DefaultParserFactory;\nuse SocialWeb\\Atproto\\Lexicon\\Parser\\DefaultSchemaRepository;\nuse SocialWeb\\Atproto\\Lexicon\\Parser\\LexiconParser;\n\n$schemas = '/path/to/bluesky-social/lexicons';\n\n$schemaRepository = new DefaultSchemaRepository($schemas);\n$parser = new LexiconParser(new DefaultParserFactory($schemaRepository));\n\n$nsid = new Nsid('app.bsky.feed.post');\n$schemaFile = $schemaRepository-\u003efindSchemaPathByNsid($nsid);\n$schemaContents = file_get_contents((string) $schemaFile);\n\n$document = $parser-\u003eparse((string) $schemaContents);\n```\n\n### Resolving References\n\nUsing this library, you may resolve references in Lexicon schemas.\n\nFor example:\n\n```php\nuse SocialWeb\\Atproto\\Lexicon\\Types\\LexResolvable;\n\nforeach ($document-\u003edefs as $defId =\u003e $def) {\n    if ($def instanceof LexResolvable) {\n        $resolved = $def-\u003eresolve();\n    }\n}\n```\n\n## Contributing\n\nContributions are welcome! To contribute, please familiarize yourself with\n[CONTRIBUTING.md](CONTRIBUTING.md).\n\n## Coordinated Disclosure\n\nKeeping user information safe and secure is a top priority, and we welcome the\ncontribution of external security researchers. If you believe you've found a\nsecurity issue in software that is maintained in this repository, please read\n[SECURITY.md](SECURITY.md) for instructions on submitting a vulnerability report.\n\n## Copyright and License\n\nCopyright © the socialweb/atproto-lexicon Contributors and licensed for use\nunder the terms of the GNU Lesser General Public License (LGPL-3.0-or-later)\nas published by the Free Software Foundation. Please see\n[COPYING.LESSER](COPYING.LESSER), [COPYING](COPYING), and [NOTICE](NOTICE)\nfor more information.\n\n\n[lexicon schemas]: https://atproto.com/guides/lexicon\n[at protocol]: https://atproto.com\n[@atproto/lexicon]: https://www.npmjs.com/package/@atproto/lexicon\n[a900e95]: https://github.com/bluesky-social/atproto/blob/a900e955a6bfabada696dbd2c2aa21a0edc48fe7/packages/lexicon/src/types.ts\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocialweb-php%2Fatproto-lexicon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocialweb-php%2Fatproto-lexicon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocialweb-php%2Fatproto-lexicon/lists"}