Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
rasheedja committed Oct 21, 2024
1 parent 1300fc1 commit 33f4296
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
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
9 changes: 9 additions & 0 deletions src/Data/OpenApi/Optics.hs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,15 @@ instance
) => LabelOptic "items" A_Lens NamedSchema NamedSchema a b where
labelOptic = #schema % #items
{-# INLINE labelOptic #-}

-- #prefixItems

instance
( a ~ Maybe OpenApiItems
, b ~ Maybe OpenApiItems
) => LabelOptic "prefixItems" A_Lens NamedSchema NamedSchema a b where
labelOptic = #schema % #items
{-# INLINE labelOptic #-}

-- #maximum

Expand Down
2 changes: 1 addition & 1 deletion test/Data/OpenApi/CommonTestTypes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ ispairSchemaJSON :: Value
ispairSchemaJSON = [aesonQQ|
{
"type": "array",
"items":
"prefixItems":
[
{ "type": "integer" },
{ "type": "string" }
Expand Down

0 comments on commit 33f4296

Please sign in to comment.