{"id":18993552,"url":"https://github.com/phpowermove/swagger","last_synced_at":"2025-04-22T12:46:19.160Z","repository":{"id":62511984,"uuid":"47128564","full_name":"phpowermove/swagger","owner":"phpowermove","description":"A php library to manipulate swagger specifications","archived":false,"fork":false,"pushed_at":"2021-09-23T15:28:19.000Z","size":75,"stargazers_count":16,"open_issues_count":0,"forks_count":18,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T15:21:08.594Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phpowermove.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}},"created_at":"2015-11-30T15:40:11.000Z","updated_at":"2022-11-06T10:15:04.000Z","dependencies_parsed_at":"2022-11-02T13:01:55.207Z","dependency_job_id":null,"html_url":"https://github.com/phpowermove/swagger","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpowermove%2Fswagger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpowermove%2Fswagger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpowermove%2Fswagger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpowermove%2Fswagger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpowermove","download_url":"https://codeload.github.com/phpowermove/swagger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249265235,"owners_count":21240542,"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":"2024-11-08T17:22:02.192Z","updated_at":"2025-04-22T12:46:19.109Z","avatar_url":"https://github.com/phpowermove.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swagger\n\n[![License](https://poser.pugx.org/gossi/swagger/license)](https://packagist.org/packages/gossi/swagger)\n[![Latest Stable Version](https://poser.pugx.org/gossi/swagger/v/stable)](https://packagist.org/packages/gossi/swagger)\n[![Total Downloads](https://poser.pugx.org/gossi/swagger/downloads)](https://packagist.org/packages/gossi/swagger)\u003cbr\u003e\n[![HHVM Status](http://hhvm.h4cc.de/badge/gossi/swagger.svg?style=flat)](http://hhvm.h4cc.de/package/gossi/swagger)\n[![Build Status](https://travis-ci.org/gossi/swagger.svg?branch=master)](https://travis-ci.org/gossi/swagger)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/gossi/swagger/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/gossi/swagger/?branch=master)\n[![Code Coverage](https://scrutinizer-ci.com/g/gossi/swagger/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/gossi/swagger/?branch=master)\n\n\nA php library to manipulate [swagger](http://swagger.io)/[Open API](https://openapis.org) specifications.\n\n## Installation\n\n```\ncomposer require gossi/swagger\n```\n\n## Usage\n\nRead an `api.json` file:\n\n```php\n$swagger = Swagger::fromFile('api.json');\n\n// or\n\n$swagger = new Swagger($array);\n```\n\n### Collections\n\nThere are two major collections: `Paths` and `Definitions`. The API is similar for both:\n\n```php\n$paths = $swagger-\u003egetPaths();\n$p = new Path('/user');\n\n// adding\n$paths-\u003eadd($p);\n\n// retrieving\nif ($paths-\u003ehas('/user') || $paths-\u003econtains($p)) {\n\t$path = $paths-\u003eget('/user');\n}\n\n// removing\n$paths-\u003eremove('/user');\n\n// iterating\nforeach ($paths as $path) {\n\t// do sth with $path\n}\n```\n\nOther collections are: `Headers`, `Parameters`, `Responses` and `SecurityDefinitions`.\n\n### Models\n\nThere are a lot of models, e.g. the mentioned `Path` above. The API is well written, so it works with the auto-completion of your IDE. It is straight forward and uses the same naming scheme as the OpenAPI specification.\n\n\n## Contributing\n\nFeel free to fork and submit a pull request (don't forget the tests) and I am happy to merge.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpowermove%2Fswagger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpowermove%2Fswagger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpowermove%2Fswagger/lists"}