mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-10 03:16:10 +00:00
Add test cases to cover different collection formats (#3640)
* add test cases to cover different collection format * add space params to retrofit 1.x * add space params to retrofit 2.x * rename url to localVarUrl * fix exception in haskell servant
This commit is contained in:
@@ -504,3 +504,28 @@ instance Consumes TestJsonFormData MimeFormUrlEncoded
|
||||
|
||||
instance Produces TestJsonFormData MimeNoContent
|
||||
|
||||
|
||||
-- *** testQueryParameterCollectionFormat
|
||||
|
||||
-- | @PUT \/fake\/test-query-paramters@
|
||||
--
|
||||
-- To test the collection format in query parameters
|
||||
--
|
||||
testQueryParameterCollectionFormat
|
||||
:: Pipe -- ^ "pipe"
|
||||
-> Ioutil -- ^ "ioutil"
|
||||
-> Http -- ^ "http"
|
||||
-> Url -- ^ "url"
|
||||
-> Context -- ^ "context"
|
||||
-> OpenAPIPetstoreRequest TestQueryParameterCollectionFormat MimeNoContent NoContent MimeNoContent
|
||||
testQueryParameterCollectionFormat (Pipe pipe) (Ioutil ioutil) (Http http) (Url url) (Context context) =
|
||||
_mkRequest "PUT" ["/fake/test-query-paramters"]
|
||||
`setQuery` toQueryColl CommaSeparated ("pipe", Just pipe)
|
||||
`setQuery` toQueryColl CommaSeparated ("ioutil", Just ioutil)
|
||||
`setQuery` toQueryColl SpaceSeparated ("http", Just http)
|
||||
`setQuery` toQueryColl CommaSeparated ("url", Just url)
|
||||
`setQuery` toQueryColl MultiParamArray ("context", Just context)
|
||||
|
||||
data TestQueryParameterCollectionFormat
|
||||
instance Produces TestQueryParameterCollectionFormat MimeNoContent
|
||||
|
||||
|
||||
@@ -93,6 +93,9 @@ newtype Byte = Byte { unByte :: ByteArray } deriving (P.Eq, P.Show)
|
||||
-- ** Callback
|
||||
newtype Callback = Callback { unCallback :: Text } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** Context
|
||||
newtype Context = Context { unContext :: [Text] } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** EnumFormString
|
||||
newtype EnumFormString = EnumFormString { unEnumFormString :: E'EnumFormString } deriving (P.Eq, P.Show)
|
||||
|
||||
@@ -120,6 +123,9 @@ newtype EnumQueryStringArray = EnumQueryStringArray { unEnumQueryStringArray ::
|
||||
-- ** File2
|
||||
newtype File2 = File2 { unFile2 :: FilePath } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** Http
|
||||
newtype Http = Http { unHttp :: [Text] } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** Int32
|
||||
newtype Int32 = Int32 { unInt32 :: Int } deriving (P.Eq, P.Show)
|
||||
|
||||
@@ -129,6 +135,9 @@ newtype Int64 = Int64 { unInt64 :: Integer } deriving (P.Eq, P.Show)
|
||||
-- ** Int64Group
|
||||
newtype Int64Group = Int64Group { unInt64Group :: Integer } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** Ioutil
|
||||
newtype Ioutil = Ioutil { unIoutil :: [Text] } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** Name2
|
||||
newtype Name2 = Name2 { unName2 :: Text } deriving (P.Eq, P.Show)
|
||||
|
||||
@@ -180,6 +189,9 @@ newtype PatternWithoutDelimiter = PatternWithoutDelimiter { unPatternWithoutDeli
|
||||
-- ** PetId
|
||||
newtype PetId = PetId { unPetId :: Integer } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** Pipe
|
||||
newtype Pipe = Pipe { unPipe :: [Text] } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** Query
|
||||
newtype Query = Query { unQuery :: Text } deriving (P.Eq, P.Show)
|
||||
|
||||
@@ -207,6 +219,9 @@ newtype StringGroup = StringGroup { unStringGroup :: Int } deriving (P.Eq, P.Sho
|
||||
-- ** Tags
|
||||
newtype Tags = Tags { unTags :: [Text] } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** Url
|
||||
newtype Url = Url { unUrl :: [Text] } deriving (P.Eq, P.Show)
|
||||
|
||||
-- ** Username
|
||||
newtype Username = Username { unUsername :: Text } deriving (P.Eq, P.Show)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user