Skip to content

Commit f990543

Browse files
committed
Add docs
1 parent cb65235 commit f990543

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,40 @@ foreach($openapi->paths as $path => $definition) {
122122
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).
123123
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).
124124

125+
Read a component schema and its properties for below spec:
126+
127+
```yaml
128+
openapi: 3.0.0
129+
info:
130+
title: Test API
131+
version: 1.0.0
132+
paths:
133+
/foo:
134+
put:
135+
description: create foo
136+
responses:
137+
'200':
138+
description: request succeeded
139+
components:
140+
schemas:
141+
Foo:
142+
description: This is an description
143+
type: object
144+
properties:
145+
message:
146+
type: string
147+
code:
148+
type: number
149+
```
150+
151+
```php
152+
# read a component schema
153+
$foo = $openapi->components->schemas['Foo'];
154+
155+
# read a property of schema
156+
$foo->properties['message']
157+
```
158+
125159
### Writing API Description Files
126160

127161
```php
@@ -298,4 +332,3 @@ Professional support, consulting as well as software development services are av
298332
https://www.cebe.cc/en/contact
299333

300334
Development of this library is sponsored by [cebe.:cloud: "Your Professional Deployment Platform"](https://cebe.cloud).
301-

composer.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
"phpunit/phpunit": "^6.5 || ^7.5 || ^8.5 || ^9.4",
2929
"oai/openapi-specification": "3.0.3",
3030
"mermade/openapi3-examples": "1.0.0",
31-
"apis-guru/openapi-directory": "1.0.0",
32-
"nexmo/api-specification": "1.0.0",
3331
"phpstan/phpstan": "^0.12.0"
3432
},
3533
"conflict": {

0 commit comments

Comments
 (0)