{"id":18551970,"url":"https://github.com/baraja-core/structured-api-doc","last_synced_at":"2025-04-09T22:31:44.202Z","repository":{"id":40250429,"uuid":"259375138","full_name":"baraja-core/structured-api-doc","owner":"baraja-core","description":"Automatically generated documentation by parsing of Structured API endpoints.","archived":false,"fork":false,"pushed_at":"2024-06-09T20:14:21.000Z","size":693,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T13:04:38.917Z","etag":null,"topics":["api","article","documentation","frontend","generator","javascript","js","php","typescript"],"latest_commit_sha":null,"homepage":"https://php.baraja.cz","language":"PHP","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/baraja-core.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},"funding":{"github":"janbarasek","custom":["https://brj.app","https://baraja.cz","https://php.baraja.cz"]}},"created_at":"2020-04-27T15:36:04.000Z","updated_at":"2024-06-09T20:14:24.000Z","dependencies_parsed_at":"2024-06-15T14:31:27.752Z","dependency_job_id":null,"html_url":"https://github.com/baraja-core/structured-api-doc","commit_stats":{"total_commits":75,"total_committers":4,"mean_commits":18.75,"dds":"0.040000000000000036","last_synced_commit":"81db5343c8953879e8b29009f67c90013057488f"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baraja-core%2Fstructured-api-doc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baraja-core%2Fstructured-api-doc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baraja-core%2Fstructured-api-doc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baraja-core%2Fstructured-api-doc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baraja-core","download_url":"https://codeload.github.com/baraja-core/structured-api-doc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248123667,"owners_count":21051509,"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":["api","article","documentation","frontend","generator","javascript","js","php","typescript"],"created_at":"2024-11-06T21:11:21.408Z","updated_at":"2025-04-09T22:31:43.365Z","avatar_url":"https://github.com/baraja-core.png","language":"PHP","funding_links":["https://github.com/sponsors/janbarasek","https://brj.app","https://baraja.cz","https://php.baraja.cz"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align='center'\u003e\n  \u003cpicture\u003e\n    \u003csource media='(prefers-color-scheme: dark)' srcset='https://cdn.brj.app/images/brj-logo/logo-regular.png'\u003e\n    \u003cimg src='https://cdn.brj.app/images/brj-logo/logo-dark.png' alt='BRJ logo'\u003e\n  \u003c/picture\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://brj.app\"\u003eBRJ organisation\u003c/a\u003e\n\u003c/div\u003e\n\u003chr\u003e\n\nStructured API Documentation\n============================\n\nFully automated tool for documentation.\n\n📦 Installation\n---------------\n\nIt's best to use [Composer](https://getcomposer.org) for installation, and you can also find the package on\n[Packagist](https://packagist.org/packages/baraja-core/structured-api-doc) and\n[GitHub](https://github.com/baraja-core/structured-api-doc).\n\nTo install, simply use the command:\n\n```shell\n$ composer require baraja-core/structured-api-doc\n```\n\nYou can use the package manually by creating an instance of the internal classes, or register a DIC extension to link the services directly to the Nette Framework.\n\n![Rendered documentation about Article](doc/sample-article.png)\n\nIdea\n----\n\nWhen developing any application, developers must maintain both the source code itself and documentation describing the general functionality for others. Writing documentation in a separate system takes more time, leads to human error, and makes the documentation obsolete over time. BRJ solves this problem by allowing developers to write documentation directly into comments in the source code, and then always machine-generate the page consistently.\n\nHow to start using BRJ documentation?\n\n1. Use Structured API endpoints (implementing [Baraja Structured API](https://github.com/baraja-core/structured-api)) to your application\n2. Install this package\n3. Open URL `/api-documentation`\n\nSample endpoint implementation with native comments:\n\n```php\n/**\n * Common API endpoint for robust article manipulation.\n *\n * @endpointName Article manager\n */\nfinal class ArticleEndpoint extends BaseEndpoint\n{\n   #[Inject]\n   public ArticleManagerAccessor $articleManager;\n\n\n   /**\n    * @param string $locale in format \"cs\" or \"en\"\n    * @param int $page real page number for filtering, 1 =\u003e first page ... \"n\" page\n    * @param string|null $filterTitle filter by words in title?\n    * @param string|null $filterFrom find all articles from this date\n    * @param string|null $filterTo find all articles to this date\n    */\n   public function actionDefault(string $locale, int $page = 1, ?string $filterTitle = null, ?string $filterFrom = null, ?string $filterTo = null): void\n   {\n      // Here is some body...\n```\n\nDesigned for developers\n-----------------------\n\nWe understand that maintaining data structures in PHP and on the frontend can be challenging, so the library includes a native button to export any response structure to TypeScript:\n\n![Native TypeScript export](doc/typescript.png)\n\n📄 License\n-----------\n\n`baraja-core/structured-api-doc` is licensed under the MIT license. See the [LICENSE](https://github.com/baraja-core/template/blob/master/LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaraja-core%2Fstructured-api-doc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaraja-core%2Fstructured-api-doc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaraja-core%2Fstructured-api-doc/lists"}