Skip to content

Commit

Permalink
add partial header to haskell http client (#6606)
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 authored Oct 2, 2017
1 parent 900aad6 commit 28a5b74
Show file tree
Hide file tree
Showing 17 changed files with 114 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{>partial_header}}
{-|
Module : {{title}}.API
-}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{>partial_header}}
{-|
Module : {{title}}.Client
-}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{>partial_header}}
{-|
Module : {{title}}.Lens
-}
Expand Down Expand Up @@ -43,4 +44,4 @@ type Lens_ s t a b = forall (f :: * -> *). Functor f => (a -> f b) -> s -> f t
{{/vars}}

{{/model}}
{{/models}}
{{/models}}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{>partial_header}}
{-|
Module : {{title}}.Logging
Katip Logging functions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{>partial_header}}
{-|
Module : {{title}}.Logging
monad-logger Logging functions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

{{>partial_header}}
{-|
Module : {{title}}.MimeTypes
-}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{>partial_header}}
{-|
Module : {{title}}.Model
-}
Expand Down Expand Up @@ -240,4 +241,4 @@ _readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStric

_showBinaryBase64 :: Binary -> Text
_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary
{-# INLINE _showBinaryBase64 #-}
{-# INLINE _showBinaryBase64 #-}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{>partial_header}}
{-|
Module : {{title}}
-}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{-
{{#appName}}
{{{appName}}}

{{/appName}}
{{#appDescription}}
{{{appDescription}}}

{{/appDescription}}
{{#version}}
OpenAPI spec version: {{{version}}}
{{/version}}
{{#infoEmail}}
Contact: {{{infoEmail}}}
{{/infoEmail}}
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
-}
10 changes: 10 additions & 0 deletions samples/client/petstore/haskell-http-client/lib/SwaggerPetstore.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{-
Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
OpenAPI spec version: 1.0.0
Contact: [email protected]
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
-}

{-|
Module : SwaggerPetstore
-}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{-
Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
OpenAPI spec version: 1.0.0
Contact: [email protected]
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
-}

{-|
Module : SwaggerPetstore.API
-}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{-
Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
OpenAPI spec version: 1.0.0
Contact: [email protected]
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
-}

{-|
Module : SwaggerPetstore.Client
-}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{-
Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
OpenAPI spec version: 1.0.0
Contact: [email protected]
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
-}

{-|
Module : SwaggerPetstore.Lens
-}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{-
Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
OpenAPI spec version: 1.0.0
Contact: [email protected]
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
-}

{-|
Module : SwaggerPetstore.Logging
Katip Logging functions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{-
Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
OpenAPI spec version: 1.0.0
Contact: [email protected]
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
-}

{-|
Module : SwaggerPetstore.MimeTypes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{-
Swagger Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
OpenAPI spec version: 1.0.0
Contact: [email protected]
Generated by Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
-}

{-|
Module : SwaggerPetstore.Model
-}
Expand Down Expand Up @@ -1413,4 +1423,4 @@ _readBinaryBase64 = P.either P.fail (pure . Binary) . BL64.decode . BL.fromStric

_showBinaryBase64 :: Binary -> Text
_showBinaryBase64 = T.decodeUtf8 . BL.toStrict . BL64.encode . unBinary
{-# INLINE _showBinaryBase64 #-}
{-# INLINE _showBinaryBase64 #-}
34 changes: 17 additions & 17 deletions samples/client/petstore/haskell-http-client/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
"type" : "array",
"items" : {
"type" : "string",
"enum" : [ "available", "pending", "sold" ],
"default" : "available"
"default" : "available",
"enum" : [ "available", "pending", "sold" ]
},
"collectionFormat" : "csv"
} ],
Expand Down Expand Up @@ -680,8 +680,8 @@
"type" : "array",
"items" : {
"type" : "string",
"enum" : [ ">", "$" ],
"default" : "$"
"default" : "$",
"enum" : [ ">", "$" ]
}
}, {
"name" : "enum_form_string",
Expand All @@ -699,8 +699,8 @@
"type" : "array",
"items" : {
"type" : "string",
"enum" : [ ">", "$" ],
"default" : "$"
"default" : "$",
"enum" : [ ">", "$" ]
}
}, {
"name" : "enum_header_string",
Expand All @@ -718,8 +718,8 @@
"type" : "array",
"items" : {
"type" : "string",
"enum" : [ ">", "$" ],
"default" : "$"
"default" : "$",
"enum" : [ ">", "$" ]
}
}, {
"name" : "enum_query_string",
Expand Down Expand Up @@ -1662,15 +1662,6 @@
"type" : "string",
"enum" : [ "placed", "approved", "delivered" ]
},
"OuterNumber" : {
"type" : "number"
},
"OuterString" : {
"type" : "string"
},
"OuterBoolean" : {
"type" : "boolean"
},
"OuterComposite" : {
"type" : "object",
"properties" : {
Expand All @@ -1684,6 +1675,15 @@
"$ref" : "#/definitions/OuterBoolean"
}
}
},
"OuterNumber" : {
"type" : "number"
},
"OuterString" : {
"type" : "string"
},
"OuterBoolean" : {
"type" : "boolean"
}
},
"externalDocs" : {
Expand Down

0 comments on commit 28a5b74

Please sign in to comment.