File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -381,10 +381,21 @@ public function jsonSerialize()
381381 $ data ->minimum = $ data ->exclusiveMinimum ;
382382 $ data ->exclusiveMinimum = true ;
383383 }
384+
384385 if (isset ($ data ->exclusiveMaximum ) && is_numeric ($ data ->exclusiveMaximum )) {
385386 $ data ->maximum = $ data ->exclusiveMaximum ;
386387 $ data ->exclusiveMaximum = true ;
387388 }
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+ }
388399 }
389400
390401 if ($ this ->_context ->isVersion (OpenApi::VERSION_3_1_0 )) {
Original file line number Diff line number Diff line change @@ -46,9 +46,8 @@ components:
4646 $ref : ' #/components/schemas/MyDateTime'
4747 nullable : true
4848 description :
49- type :
50- - string
51- - ' null'
49+ type : string
50+ nullable : true
5251 choice :
5352 type : string
5453 enum :
You can’t perform that action at this time.
0 commit comments