forked from loafle/openapi-generator-original
handle composed schemas in InlineModelResolver (#2112)
* handle composed schemas in InlineModelResolver * fix unit test -> TestUtils.parseSpec * update samples * fix samples * update samples * update samples * add new files
This commit is contained in:
committed by
William Cheng
parent
7eb2be9c99
commit
ee43cc1520
@@ -723,6 +723,34 @@ mkCat catClassName =
|
||||
, catDeclawed = Nothing
|
||||
}
|
||||
|
||||
-- ** CatAllOf
|
||||
-- | CatAllOf
|
||||
data CatAllOf = CatAllOf
|
||||
{ catAllOfDeclawed :: !(Maybe Bool) -- ^ "declawed"
|
||||
} deriving (P.Show, P.Eq, P.Typeable)
|
||||
|
||||
-- | FromJSON CatAllOf
|
||||
instance A.FromJSON CatAllOf where
|
||||
parseJSON = A.withObject "CatAllOf" $ \o ->
|
||||
CatAllOf
|
||||
<$> (o .:? "declawed")
|
||||
|
||||
-- | ToJSON CatAllOf
|
||||
instance A.ToJSON CatAllOf where
|
||||
toJSON CatAllOf {..} =
|
||||
_omitNulls
|
||||
[ "declawed" .= catAllOfDeclawed
|
||||
]
|
||||
|
||||
|
||||
-- | Construct a value of type 'CatAllOf' (by applying it's required fields, if any)
|
||||
mkCatAllOf
|
||||
:: CatAllOf
|
||||
mkCatAllOf =
|
||||
CatAllOf
|
||||
{ catAllOfDeclawed = Nothing
|
||||
}
|
||||
|
||||
-- ** Category
|
||||
-- | Category
|
||||
data Category = Category
|
||||
@@ -850,6 +878,34 @@ mkDog dogClassName =
|
||||
, dogBreed = Nothing
|
||||
}
|
||||
|
||||
-- ** DogAllOf
|
||||
-- | DogAllOf
|
||||
data DogAllOf = DogAllOf
|
||||
{ dogAllOfBreed :: !(Maybe Text) -- ^ "breed"
|
||||
} deriving (P.Show, P.Eq, P.Typeable)
|
||||
|
||||
-- | FromJSON DogAllOf
|
||||
instance A.FromJSON DogAllOf where
|
||||
parseJSON = A.withObject "DogAllOf" $ \o ->
|
||||
DogAllOf
|
||||
<$> (o .:? "breed")
|
||||
|
||||
-- | ToJSON DogAllOf
|
||||
instance A.ToJSON DogAllOf where
|
||||
toJSON DogAllOf {..} =
|
||||
_omitNulls
|
||||
[ "breed" .= dogAllOfBreed
|
||||
]
|
||||
|
||||
|
||||
-- | Construct a value of type 'DogAllOf' (by applying it's required fields, if any)
|
||||
mkDogAllOf
|
||||
:: DogAllOf
|
||||
mkDogAllOf =
|
||||
DogAllOf
|
||||
{ dogAllOfBreed = Nothing
|
||||
}
|
||||
|
||||
-- ** EnumArrays
|
||||
-- | EnumArrays
|
||||
data EnumArrays = EnumArrays
|
||||
|
||||
@@ -281,6 +281,15 @@ catDeclawedL f Cat{..} = (\catDeclawed -> Cat { catDeclawed, ..} ) <$> f catDecl
|
||||
|
||||
|
||||
|
||||
-- * CatAllOf
|
||||
|
||||
-- | 'catAllOfDeclawed' Lens
|
||||
catAllOfDeclawedL :: Lens_' CatAllOf (Maybe Bool)
|
||||
catAllOfDeclawedL f CatAllOf{..} = (\catAllOfDeclawed -> CatAllOf { catAllOfDeclawed, ..} ) <$> f catAllOfDeclawed
|
||||
{-# INLINE catAllOfDeclawedL #-}
|
||||
|
||||
|
||||
|
||||
-- * Category
|
||||
|
||||
-- | 'categoryId' Lens
|
||||
@@ -332,6 +341,15 @@ dogBreedL f Dog{..} = (\dogBreed -> Dog { dogBreed, ..} ) <$> f dogBreed
|
||||
|
||||
|
||||
|
||||
-- * DogAllOf
|
||||
|
||||
-- | 'dogAllOfBreed' Lens
|
||||
dogAllOfBreedL :: Lens_' DogAllOf (Maybe Text)
|
||||
dogAllOfBreedL f DogAllOf{..} = (\dogAllOfBreed -> DogAllOf { dogAllOfBreed, ..} ) <$> f dogAllOfBreed
|
||||
{-# INLINE dogAllOfBreedL #-}
|
||||
|
||||
|
||||
|
||||
-- * EnumArrays
|
||||
|
||||
-- | 'enumArraysJustSymbol' Lens
|
||||
|
||||
Reference in New Issue
Block a user