Skip to content

Commit 6735497

Browse files
committed
Use prefixItems for tuples
+ 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]
1 parent 1300fc1 commit 6735497

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Data/OpenApi/Internal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ instance ToJSON OpenApiItems where
13731373
, "maxItems" .= (0 :: Int)
13741374
, "example" .= Array mempty
13751375
]
1376-
toJSON (OpenApiItemsArray x) = object [ "items" .= x ]
1376+
toJSON (OpenApiItemsArray x) = object [ "prefixItems" .= x ]
13771377

13781378
instance ToJSON Components where
13791379
toJSON = sopSwaggerGenericToJSON

0 commit comments

Comments
 (0)