@@ -78,6 +78,7 @@ spec = do
78 context "Email (unwrapUnaryRecords)" $ checkToSchema (Proxy :: Proxy Email) emailSchemaJSON
78 context "Email (unwrapUnaryRecords)" $ checkToSchema (Proxy :: Proxy Email) emailSchemaJSON
79 context "UserId (non-record newtype)" $ checkToSchema (Proxy :: Proxy UserId) userIdSchemaJSON
79 context "UserId (non-record newtype)" $ checkToSchema (Proxy :: Proxy UserId) userIdSchemaJSON
80 context "Player (unary record)" $ checkToSchema (Proxy :: Proxy Player) playerSchemaJSON
80 context "Player (unary record)" $ checkToSchema (Proxy :: Proxy Player) playerSchemaJSON
81+ context "SingleMaybeField (unary record with Maybe)" $ checkToSchema (Proxy :: Proxy SingleMaybeField) singleMaybeFieldSchemaJSON
81 context "Players (inlining schema)" $ checkToSchema (Proxy :: Proxy Players) playersSchemaJSON
82 context "Players (inlining schema)" $ checkToSchema (Proxy :: Proxy Players) playersSchemaJSON
82 context "MyRoseTree (datatypeNameModifier)" $ checkToSchema (Proxy :: Proxy MyRoseTree) myRoseTreeSchemaJSON
83 context "MyRoseTree (datatypeNameModifier)" $ checkToSchema (Proxy :: Proxy MyRoseTree) myRoseTreeSchemaJSON
83 context "MyRoseTree' (datatypeNameModifier)" $ checkToSchema (Proxy :: Proxy MyRoseTree') myRoseTreeSchemaJSON'
84 context "MyRoseTree' (datatypeNameModifier)" $ checkToSchema (Proxy :: Proxy MyRoseTree') myRoseTreeSchemaJSON'
@@ -722,3 +723,24 @@ buttonImagesSchemaJSON = [aesonQQ|
727+-- ========================================================================
728+-- SingleMaybeField (single field data with optional field)
729+-- ========================================================================
731+data SingleMaybeField = SingleMaybeField { singleMaybeField :: Maybe String }
732+ deriving (Show, Generic)
734+instance ToJSON SingleMaybeField
735+instance ToSchema SingleMaybeField
737+singleMaybeFieldSchemaJSON :: Value
738+singleMaybeFieldSchemaJSON = [aesonQQ|
743+ "singleMaybeField": { "type": "string" }