{"id":24411209,"url":"https://github.com/membrane-php/openapi-reader","last_synced_at":"2025-03-13T10:18:44.359Z","repository":{"id":192654899,"uuid":"685901387","full_name":"membrane-php/openapi-reader","owner":"membrane-php","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-21T19:09:14.000Z","size":226,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-21T23:17:44.354Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/membrane-php.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}},"created_at":"2023-09-01T09:13:17.000Z","updated_at":"2024-04-23T11:46:17.879Z","dependencies_parsed_at":null,"dependency_job_id":"31175464-3b67-4909-ba9a-8273f1635db9","html_url":"https://github.com/membrane-php/openapi-reader","commit_stats":null,"previous_names":["membrane-php/openapi-reader"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membrane-php%2Fopenapi-reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membrane-php%2Fopenapi-reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membrane-php%2Fopenapi-reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membrane-php%2Fopenapi-reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/membrane-php","download_url":"https://codeload.github.com/membrane-php/openapi-reader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243382931,"owners_count":20282051,"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":[],"created_at":"2025-01-20T06:33:54.930Z","updated_at":"2025-03-13T10:18:44.326Z","avatar_url":"https://github.com/membrane-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAPI Reader\n\nThis library is intended to be used in conjunction with other Membrane libraries.\n\nIt wraps the [php-openapi](https://github.com/cebe/php-openapi) library with some additional validation, including\nMembrane-specific requirements.\n\n## Requirements\n\n- A valid [OpenAPI specification](https://github.com/OAI/OpenAPI-Specification#readme).\n- An operationId on all [Operation Objects](https://spec.openapis.org/oas/v3.1.0#operation-object) so that each route is\n  uniquely identifiable.\n\n## Installation\n\n```text\ncomposer require membrane/openapi-router\n```\n\n## Quick Start\n\n### Instantiate a Reader\n\n```php\n$versions = [\\Membrane\\OpenAPIReader\\OpenAPIVersion::Version_3_0];\n\n$reader = new \\Membrane\\OpenAPIReader\\Reader($versions);\n```\n\n### Read From An Absolute File Path\n\nThis method is the main use-case of the reader and is capable of _resolving all references._\n\nIf your file path contains the file extension then the reader can use this to determine which language the OpenAPI is\nwritten in.\n\n```php\n// code to instantiate reader... \n\n$reader-\u003ereadFromAbsoluteFilePath('~/path/to/my-openapi.yaml');\n```\n\nOtherwise, you may ensure it reads the file as a specific format by providing a second argument:\n\n```php\n// code to instantiate reader... \n\n$fileFormat = \\Membrane\\OpenAPIReader\\FileFormat::Json;\n\n$reader-\u003ereadFromAbsoluteFilePath('my-openapi', $fileFormat);\n```\n\n### Read From A String\n\nThis method is only capable of resolving\n[Reference Objects](https://spec.openapis.org/oas/v3.1.0#reference-object-example),\nit cannot resolve references to\n[Relative Documents](https://spec.openapis.org/oas/v3.1.0#relative-schema-document-example)\n.\n\nBecause the OpenAPI will be read from a string, the FileFormat MUST be provided.\n\n```php\n// code to instantiate reader... \n\n$myOpenAPI = '\u003cInsert your OpenAPI Spec here\u003e';\n$fileFormat = \\Membrane\\OpenAPIReader\\FileFormat::Json;\n\n$reader-\u003ereadFromString($myOpenAPI, $fileFormat)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembrane-php%2Fopenapi-reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmembrane-php%2Fopenapi-reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembrane-php%2Fopenapi-reader/lists"}