Skip to content

Commit

Permalink
Touchups for new oneOf support
Browse files Browse the repository at this point in the history
  • Loading branch information
qxjit committed Mar 22, 2024
1 parent 5761301 commit f78fc83
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
5 changes: 2 additions & 3 deletions json-fleece-codegen-util/src/Fleece/CodeGenUtil.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1382,15 +1382,14 @@ generateFleeceObject typeMap typeName codeGenFields mbAdditionalProperties typeO
case mbAdditionalPropertiesSchemaTypeInfo of
Nothing ->
[]
Just additionalPropsTypeInfo -> do
Just additionalPropsTypeInfo ->
[
( additionalPropsFieldName
, schemaTypeExpr (mapTypeInfo additionalPropsTypeInfo)
, Nothing
)
]
]

let
fieldNameAndType field =
(fieldName field, fieldTypeName field, fieldDescription field)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ unionTypeList members =
fromCode $
lines
( toCode union
: map (indent 2 . toCode) (delimitLines "'[ " " , " members <> ["]"])
: map (indent 2 . toCode) (delimitLines "'[ " " , " members <> [" ]"])
)

quote :: HaskellCode -> HaskellCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ newtype OneOfWithNullable = OneOfWithNullable (Shrubbery.Union
, [AStringType.AStringType]
, Either FC.Null [AStringType.AStringType]
, [Either FC.Null [AStringType.AStringType]]
])
])
deriving (Show, Eq)

oneOfWithNullableSchema :: FC.Fleece schema => schema OneOfWithNullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ newtype ReferenceOneOfInsideOneOf = ReferenceOneOfInsideOneOf (Shrubbery.Union
'[ ReferenceOneOf.ReferenceOneOf
, TopLevelOneOfOneOption.TopLevelOneOfOneOption
, [TopLevelOneOfOneOption.TopLevelOneOfOneOption]
])
])
deriving (Show, Eq)

referenceOneOfInsideOneOfSchema :: FC.Fleece schema => schema ReferenceOneOfInsideOneOf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ newtype TopLevelOneOf = TopLevelOneOf (Shrubbery.Union
, Num2SchemaStartingWithNumber.Num2SchemaStartingWithNumber
, [FieldDescriptions.FieldDescriptions]
, [[MixedInJustAdditionalPropertiesSchemaInline.MixedInJustAdditionalPropertiesSchemaInline]]
])
])
deriving (Show, Eq)

topLevelOneOfSchema :: FC.Fleece schema => schema TopLevelOneOf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import qualified Shrubbery as Shrubbery

newtype TopLevelOneOfOneOption = TopLevelOneOfOneOption (Shrubbery.Union
'[ T.Text
])
])
deriving (Show, Eq)

topLevelOneOfOneOptionSchema :: FC.Fleece schema => schema TopLevelOneOfOneOption
Expand Down

0 comments on commit f78fc83

Please sign in to comment.