From cb65235357707060c7d28cba4ed4f3a8827706c7 Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Thu, 23 Jan 2025 16:12:26 +0530 Subject: [PATCH 1/3] Create PR --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ea32da82..a077b532 100644 --- a/README.md +++ b/README.md @@ -298,3 +298,4 @@ Professional support, consulting as well as software development services are av https://www.cebe.cc/en/contact Development of this library is sponsored by [cebe.:cloud: "Your Professional Deployment Platform"](https://cebe.cloud). + From f990543b62ac0b78a7a5c6c4b91e3c92bbd41f4e Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 24 Jan 2025 19:27:11 +0530 Subject: [PATCH 2/3] Add docs --- README.md | 35 ++++++++++++++++++++++++++++++++++- composer.json | 2 -- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a077b532..d7cd0715 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,40 @@ foreach($openapi->paths as $path => $definition) { Object properties are exactly like in the [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#openapi-specification). You may also access additional properties added by [specification extensions](https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#specificationExtensions). +Read a component schema and its properties for below spec: + +```yaml +openapi: 3.0.0 +info: + title: Test API + version: 1.0.0 +paths: + /foo: + put: + description: create foo + responses: + '200': + description: request succeeded +components: + schemas: + Foo: + description: This is an description + type: object + properties: + message: + type: string + code: + type: number +``` + +```php +# read a component schema +$foo = $openapi->components->schemas['Foo']; + +# read a property of schema +$foo->properties['message'] +``` + ### Writing API Description Files ```php @@ -298,4 +332,3 @@ Professional support, consulting as well as software development services are av https://www.cebe.cc/en/contact Development of this library is sponsored by [cebe.:cloud: "Your Professional Deployment Platform"](https://cebe.cloud). - diff --git a/composer.json b/composer.json index a3054a52..edabaf1e 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,6 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", - "apis-guru/openapi-directory": "1.0.0", - "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, "conflict": { From 6788b09af61ff81f19a005426ee151ad3e3bf8de Mon Sep 17 00:00:00 2001 From: Sohel Ahmed Mesaniya Date: Fri, 24 Jan 2025 19:28:08 +0530 Subject: [PATCH 3/3] Add back removed dependencies --- composer.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/composer.json b/composer.json index edabaf1e..a3054a52 100644 --- a/composer.json +++ b/composer.json @@ -28,6 +28,8 @@ "phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4", "oai/openapi-specification": "3.0.3", "mermade/openapi3-examples": "1.0.0", + "apis-guru/openapi-directory": "1.0.0", + "nexmo/api-specification": "1.0.0", "phpstan/phpstan": "^0.12.0" }, "conflict": {