Skip to content

Commit d6d2c6f

Browse files
committed
finished Xml, Tag, Type, Server and ServerVariable
1 parent fdacf32 commit d6d2c6f

25 files changed

Lines changed: 139 additions & 53 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ This library is currently work in progress, the following list tracks completene
7676
- [x] Link Object
7777
- [ ] [Runtime Expressions](https://github.com/OAI/OpenAPI-Specification/blob/3.0.2/versions/3.0.2.md#runtime-expressions)
7878
- [ ] Header Object
79-
- [ ] Tag Object
79+
- [x] Tag Object
8080
- [ ] Reference Object
8181
- [x] Schema Object
8282
- [x] load/read

src/SpecBaseObject.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ public function validate(): bool
117117
foreach ($this->_properties as $v) {
118118
if ($v instanceof self) {
119119
$v->validate();
120+
} elseif (is_array($v)) {
121+
foreach($v as $item) {
122+
if ($item instanceof self) {
123+
$item->validate();
124+
}
125+
}
120126
}
121127
}
122128
$this->performValidation();
@@ -133,6 +139,12 @@ public function getErrors(): array
133139
foreach ($this->_properties as $v) {
134140
if ($v instanceof self) {
135141
$errors[] = $v->getErrors();
142+
} elseif (is_array($v)) {
143+
foreach($v as $item) {
144+
if ($item instanceof self) {
145+
$errors[] = $item->getErrors();
146+
}
147+
}
136148
}
137149
}
138150
return array_merge(...$errors);

src/spec/Components.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ protected function attributes(): array
5151

5252
/**
5353
* Perform validation on this object, check data against OpenAPI Specification rules.
54-
*
55-
* Call `addError()` in case of validation errors.
5654
*/
5755
protected function performValidation()
5856
{

src/spec/Contact.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ protected function attributes(): array
3535

3636
/**
3737
* Perform validation on this object, check data against OpenAPI Specification rules.
38-
*
39-
* Call `addError()` in case of validation errors.
4038
*/
4139
protected function performValidation()
4240
{

src/spec/Discriminator.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ protected function attributes(): array
3333

3434
/**
3535
* Perform validation on this object, check data against OpenAPI Specification rules.
36-
*
37-
* Call `addError()` in case of validation errors.
3836
*/
3937
protected function performValidation()
4038
{

src/spec/ExternalDocumentation.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ protected function attributes(): array
3333

3434
/**
3535
* Perform validation on this object, check data against OpenAPI Specification rules.
36-
*
37-
* Call `addError()` in case of validation errors.
3836
*/
3937
protected function performValidation()
4038
{

src/spec/Info.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ protected function attributes(): array
4343

4444
/**
4545
* Perform validation on this object, check data against OpenAPI Specification rules.
46-
*
47-
* Call `addError()` in case of validation errors.
4846
*/
4947
protected function performValidation()
5048
{

src/spec/License.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ protected function attributes(): array
3333

3434
/**
3535
* Perform validation on this object, check data against OpenAPI Specification rules.
36-
*
37-
* Call `addError()` in case of validation errors.
3836
*/
3937
protected function performValidation()
4038
{

src/spec/Link.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ protected function attributes(): array
4141

4242
/**
4343
* Perform validation on this object, check data against OpenAPI Specification rules.
44-
*
45-
* Call `addError()` in case of validation errors.
4644
*/
4745
protected function performValidation()
4846
{

src/spec/OpenApi.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ protected function attributes(): array
4545

4646
/**
4747
* Perform validation on this object, check data against OpenAPI Specification rules.
48-
*
49-
* Call `addError()` in case of validation errors.
5048
*/
5149
public function performValidation()
5250
{

0 commit comments

Comments
 (0)