@@ -165,16 +165,6 @@ public function __set(string $property, $value): void
165
165
$ this ->_context ->logger ->warning ('Ignoring unexpected property " ' . $ property . '" for ' . $ this ->identity () . ', expecting " ' . implode ('", " ' , array_keys ($ fields )) . '" in ' . $ this ->_context );
166
166
}
167
167
168
- /**
169
- * Check if one of the given version numbers matches the current OpenAPI version.
170
- *
171
- * @param string|array $versions One or more version numbers
172
- */
173
- public function isOpenApiVersion ($ versions ): bool
174
- {
175
- return $ this ->_context ->isVersion ($ versions );
176
- }
177
-
178
168
/**
179
169
* Merge given annotations to their mapped properties configured in static::$_nested.
180
170
*
@@ -360,7 +350,7 @@ public function jsonSerialize()
360
350
if (isset ($ data ->ref )) {
361
351
// Only specific https://github.com/OAI/OpenAPI-Specification/blob/3.1.0/versions/3.1.0.md#reference-object
362
352
$ ref = ['$ref ' => $ data ->ref ];
363
- if ($ this ->isOpenApiVersion (OpenApi::VERSION_3_1_0 )) {
353
+ if ($ this ->_context -> isVersion (OpenApi::VERSION_3_1_0 )) {
364
354
foreach (['summary ' , 'description ' ] as $ prop ) {
365
355
if (property_exists ($ this , $ prop )) {
366
356
if (!Generator::isDefault ($ this ->{$ prop })) {
@@ -371,7 +361,7 @@ public function jsonSerialize()
371
361
}
372
362
if (property_exists ($ this , 'nullable ' ) && $ this ->nullable === true ) {
373
363
$ ref = ['oneOf ' => [$ ref ]];
374
- if ($ this ->isOpenApiVersion (OpenApi::VERSION_3_1_0 )) {
364
+ if ($ this ->_context -> isVersion (OpenApi::VERSION_3_1_0 )) {
375
365
$ ref ['oneOf ' ][] = ['type ' => 'null ' ];
376
366
} else {
377
367
$ ref ['nullable ' ] = $ data ->nullable ;
@@ -391,7 +381,7 @@ public function jsonSerialize()
391
381
$ data = (object ) $ ref ;
392
382
}
393
383
394
- if ($ this ->isOpenApiVersion (OpenApi::VERSION_3_0_0 )) {
384
+ if ($ this ->_context -> isVersion (OpenApi::VERSION_3_0_0 )) {
395
385
if (isset ($ data ->exclusiveMinimum ) && is_numeric ($ data ->exclusiveMinimum )) {
396
386
$ data ->minimum = $ data ->exclusiveMinimum ;
397
387
$ data ->exclusiveMinimum = true ;
@@ -402,7 +392,7 @@ public function jsonSerialize()
402
392
}
403
393
}
404
394
405
- if ($ this ->isOpenApiVersion (OpenApi::VERSION_3_1_0 )) {
395
+ if ($ this ->_context -> isVersion (OpenApi::VERSION_3_1_0 )) {
406
396
if (isset ($ data ->nullable )) {
407
397
if (true === $ data ->nullable ) {
408
398
if (isset ($ data ->oneOf )) {
0 commit comments