Skip to content

Commit

Permalink
Use prefixItems for tuples
Browse files Browse the repository at this point in the history
+ From OpenApi 3.1
+ Preserves order for tuples
  + e.g., when generating typescript from generated openapi specs
    + (a, b) becomes [a, b] instead of [a || b, a || b]
  • Loading branch information
rasheedja committed Oct 15, 2024
1 parent 1300fc1 commit 6735497
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Data/OpenApi/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,7 @@ instance ToJSON OpenApiItems where
, "maxItems" .= (0 :: Int)
, "example" .= Array mempty
]
toJSON (OpenApiItemsArray x) = object [ "items" .= x ]
toJSON (OpenApiItemsArray x) = object [ "prefixItems" .= x ]

instance ToJSON Components where
toJSON = sopSwaggerGenericToJSON
Expand Down

0 comments on commit 6735497

Please sign in to comment.