File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -381,10 +381,21 @@ public function jsonSerialize()
381
381
$ data ->minimum = $ data ->exclusiveMinimum ;
382
382
$ data ->exclusiveMinimum = true ;
383
383
}
384
+
384
385
if (isset ($ data ->exclusiveMaximum ) && is_numeric ($ data ->exclusiveMaximum )) {
385
386
$ data ->maximum = $ data ->exclusiveMaximum ;
386
387
$ data ->exclusiveMaximum = true ;
387
388
}
389
+
390
+ if (isset ($ data ->type ) && is_array ($ data ->type )) {
391
+ if (in_array ('null ' , $ data ->type )) {
392
+ $ data ->nullable = true ;
393
+ $ data ->type = array_filter ($ data ->type , fn ($ v ): bool => $ v !== 'null ' );
394
+ if (1 === count ($ data ->type )) {
395
+ $ data ->type = array_pop ($ data ->type );
396
+ }
397
+ }
398
+ }
388
399
}
389
400
390
401
if ($ this ->_context ->isVersion (OpenApi::VERSION_3_1_0 )) {
Original file line number Diff line number Diff line change @@ -46,9 +46,8 @@ components:
46
46
$ref : ' #/components/schemas/MyDateTime'
47
47
nullable : true
48
48
description :
49
- type :
50
- - string
51
- - ' null'
49
+ type : string
50
+ nullable : true
52
51
choice :
53
52
type : string
54
53
enum :
You can’t perform that action at this time.
0 commit comments