Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sponsor message in F# giraffe generator #9247

Merged
merged 1 commit into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,17 @@ public Mustache.Compiler processCompiler(Mustache.Compiler compiler) {
public String toRegularExpression(String pattern) {
return escapeText(pattern);
}
}

@Override
public void postProcess() {
System.out.println("################################################################################");
System.out.println("# Thanks for using OpenAPI Generator. #");
System.out.println("# Please consider donation to help us maintain this project \uD83D\uDE4F #");
System.out.println("# https://opencollective.com/openapi_generator/donate #");
System.out.println("# #");
System.out.println("# This generator's contributed by Nick Fisher (https://github.com/nmfisher) #");
System.out.println("# Please support his work directly via https://paypal.me/nickfisher1984 \uD83D\uDE4F #");
System.out.println("################################################################################");
}

}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.3-SNAPSHOT
5.1.1-SNAPSHOT
2 changes: 0 additions & 2 deletions samples/server/petstore/fsharp-giraffe/OpenAPI/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ The following models have been auto-generated from the provided OpenAPI schema:
- model/TagModel.fs
- model/CategoryModel.fs
- model/OrderModel.fs
- model/InlineObject1Model.fs
- model/InlineObjectModel.fs
- model/PetModel.fs
- model/ApiResponseModel.fs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
<Compile Include="model/Tag.fs" />
<Compile Include="model/Category.fs" />
<Compile Include="model/Order.fs" />
<Compile Include="model/InlineObject1.fs" />
<Compile Include="model/InlineObject.fs" />
<Compile Include="model/Pet.fs" />
<Compile Include="model/ApiResponse.fs" />
<Compile Include="api/PetApiHandlerParams.fs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ module PetApiHandler =
let serviceArgs = { bodyParams=bodyParams } : AddPetArgs
let result = PetApiService.AddPet ctx serviceArgs
return! (match result with
| AddPetStatusCode200 resolved ->
setStatusCode 200 >=> json resolved.content
| AddPetStatusCode405 resolved ->
setStatusCode 405 >=> text resolved.content
setStatusCode 405 >=> text resolved.content
) next ctx
}
//#endregion
Expand All @@ -50,7 +52,7 @@ module PetApiHandler =
let result = PetApiService.DeletePet ctx serviceArgs
return! (match result with
| DeletePetStatusCode400 resolved ->
setStatusCode 400 >=> text resolved.content
setStatusCode 400 >=> text resolved.content
) next ctx
}
//#endregion
Expand All @@ -67,10 +69,10 @@ module PetApiHandler =
let serviceArgs = { queryParams=queryParams; } : FindPetsByStatusArgs
let result = PetApiService.FindPetsByStatus ctx serviceArgs
return! (match result with
| FindPetsByStatusDefaultStatusCode resolved ->
setStatusCode 200 >=> json resolved.content
| FindPetsByStatusStatusCode200 resolved ->
setStatusCode 200 >=> json resolved.content
| FindPetsByStatusStatusCode400 resolved ->
setStatusCode 400 >=> text resolved.content
setStatusCode 400 >=> text resolved.content
) next ctx
}
//#endregion
Expand All @@ -87,10 +89,10 @@ module PetApiHandler =
let serviceArgs = { queryParams=queryParams; } : FindPetsByTagsArgs
let result = PetApiService.FindPetsByTags ctx serviceArgs
return! (match result with
| FindPetsByTagsDefaultStatusCode resolved ->
setStatusCode 200 >=> json resolved.content
| FindPetsByTagsStatusCode200 resolved ->
setStatusCode 200 >=> json resolved.content
| FindPetsByTagsStatusCode400 resolved ->
setStatusCode 400 >=> text resolved.content
setStatusCode 400 >=> text resolved.content
) next ctx
}
//#endregion
Expand All @@ -106,12 +108,12 @@ module PetApiHandler =
let serviceArgs = { pathParams=pathParams; } : GetPetByIdArgs
let result = PetApiService.GetPetById ctx serviceArgs
return! (match result with
| GetPetByIdDefaultStatusCode resolved ->
setStatusCode 200 >=> json resolved.content
| GetPetByIdStatusCode200 resolved ->
setStatusCode 200 >=> json resolved.content
| GetPetByIdStatusCode400 resolved ->
setStatusCode 400 >=> text resolved.content
setStatusCode 400 >=> text resolved.content
| GetPetByIdStatusCode404 resolved ->
setStatusCode 404 >=> text resolved.content
setStatusCode 404 >=> text resolved.content
) next ctx
}
//#endregion
Expand All @@ -129,12 +131,14 @@ module PetApiHandler =
let serviceArgs = { bodyParams=bodyParams } : UpdatePetArgs
let result = PetApiService.UpdatePet ctx serviceArgs
return! (match result with
| UpdatePetStatusCode200 resolved ->
setStatusCode 200 >=> json resolved.content
| UpdatePetStatusCode400 resolved ->
setStatusCode 400 >=> text resolved.content
setStatusCode 400 >=> text resolved.content
| UpdatePetStatusCode404 resolved ->
setStatusCode 404 >=> text resolved.content
setStatusCode 404 >=> text resolved.content
| UpdatePetStatusCode405 resolved ->
setStatusCode 405 >=> text resolved.content
setStatusCode 405 >=> text resolved.content
) next ctx
}
//#endregion
Expand All @@ -152,7 +156,7 @@ module PetApiHandler =
let result = PetApiService.UpdatePetWithForm ctx serviceArgs
return! (match result with
| UpdatePetWithFormStatusCode405 resolved ->
setStatusCode 405 >=> text resolved.content
setStatusCode 405 >=> text resolved.content
) next ctx
}
//#endregion
Expand All @@ -169,8 +173,8 @@ module PetApiHandler =
let serviceArgs = { formParams=formParams; pathParams=pathParams; } : UploadFileArgs
let result = PetApiService.UploadFile ctx serviceArgs
return! (match result with
| UploadFileDefaultStatusCode resolved ->
setStatusCode 200 >=> json resolved.content
| UploadFileStatusCode200 resolved ->
setStatusCode 200 >=> json resolved.content
) next ctx
}
//#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ module PetApiHandlerParams =
//#endregion


type AddPetStatusCode200Response = {
content:Pet;

}

type AddPetStatusCode405Response = {
content:string;

}
type AddPetResult = AddPetStatusCode405 of AddPetStatusCode405Response
type AddPetResult = AddPetStatusCode200 of AddPetStatusCode200Response|AddPetStatusCode405 of AddPetStatusCode405Response

type AddPetArgs = {
bodyParams:AddPetBodyParams
Expand Down Expand Up @@ -58,7 +63,7 @@ module PetApiHandlerParams =
//#endregion


type FindPetsByStatusDefaultStatusCodeResponse = {
type FindPetsByStatusStatusCode200Response = {
content:Pet[];

}
Expand All @@ -67,7 +72,7 @@ module PetApiHandlerParams =
content:string;

}
type FindPetsByStatusResult = FindPetsByStatusDefaultStatusCode of FindPetsByStatusDefaultStatusCodeResponse|FindPetsByStatusStatusCode400 of FindPetsByStatusStatusCode400Response
type FindPetsByStatusResult = FindPetsByStatusStatusCode200 of FindPetsByStatusStatusCode200Response|FindPetsByStatusStatusCode400 of FindPetsByStatusStatusCode400Response

type FindPetsByStatusArgs = {
queryParams:Result<FindPetsByStatusQueryParams,string>;
Expand All @@ -82,7 +87,7 @@ module PetApiHandlerParams =
//#endregion


type FindPetsByTagsDefaultStatusCodeResponse = {
type FindPetsByTagsStatusCode200Response = {
content:Pet[];

}
Expand All @@ -91,7 +96,7 @@ module PetApiHandlerParams =
content:string;

}
type FindPetsByTagsResult = FindPetsByTagsDefaultStatusCode of FindPetsByTagsDefaultStatusCodeResponse|FindPetsByTagsStatusCode400 of FindPetsByTagsStatusCode400Response
type FindPetsByTagsResult = FindPetsByTagsStatusCode200 of FindPetsByTagsStatusCode200Response|FindPetsByTagsStatusCode400 of FindPetsByTagsStatusCode400Response

type FindPetsByTagsArgs = {
queryParams:Result<FindPetsByTagsQueryParams,string>;
Expand All @@ -104,7 +109,7 @@ module PetApiHandlerParams =
//#endregion


type GetPetByIdDefaultStatusCodeResponse = {
type GetPetByIdStatusCode200Response = {
content:Pet;

}
Expand All @@ -118,7 +123,7 @@ module PetApiHandlerParams =
content:string;

}
type GetPetByIdResult = GetPetByIdDefaultStatusCode of GetPetByIdDefaultStatusCodeResponse|GetPetByIdStatusCode400 of GetPetByIdStatusCode400Response|GetPetByIdStatusCode404 of GetPetByIdStatusCode404Response
type GetPetByIdResult = GetPetByIdStatusCode200 of GetPetByIdStatusCode200Response|GetPetByIdStatusCode400 of GetPetByIdStatusCode400Response|GetPetByIdStatusCode404 of GetPetByIdStatusCode404Response

type GetPetByIdArgs = {
pathParams:GetPetByIdPathParams;
Expand All @@ -130,6 +135,11 @@ module PetApiHandlerParams =
//#endregion


type UpdatePetStatusCode200Response = {
content:Pet;

}

type UpdatePetStatusCode400Response = {
content:string;

Expand All @@ -144,7 +154,7 @@ module PetApiHandlerParams =
content:string;

}
type UpdatePetResult = UpdatePetStatusCode400 of UpdatePetStatusCode400Response|UpdatePetStatusCode404 of UpdatePetStatusCode404Response|UpdatePetStatusCode405 of UpdatePetStatusCode405Response
type UpdatePetResult = UpdatePetStatusCode200 of UpdatePetStatusCode200Response|UpdatePetStatusCode400 of UpdatePetStatusCode400Response|UpdatePetStatusCode404 of UpdatePetStatusCode404Response|UpdatePetStatusCode405 of UpdatePetStatusCode405Response

type UpdatePetArgs = {
bodyParams:UpdatePetBodyParams
Expand Down Expand Up @@ -197,11 +207,11 @@ module PetApiHandlerParams =
//#endregion


type UploadFileDefaultStatusCodeResponse = {
type UploadFileStatusCode200Response = {
content:ApiResponse;

}
type UploadFileResult = UploadFileDefaultStatusCode of UploadFileDefaultStatusCodeResponse
type UploadFileResult = UploadFileStatusCode200 of UploadFileStatusCode200Response

type UploadFileArgs = {
pathParams:UploadFilePathParams;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ module StoreApiHandler =
let result = StoreApiService.DeleteOrder ctx serviceArgs
return! (match result with
| DeleteOrderStatusCode400 resolved ->
setStatusCode 400 >=> text resolved.content
setStatusCode 400 >=> text resolved.content
| DeleteOrderStatusCode404 resolved ->
setStatusCode 404 >=> text resolved.content
setStatusCode 404 >=> text resolved.content
) next ctx
}
//#endregion
Expand All @@ -45,8 +45,8 @@ module StoreApiHandler =
task {
let result = StoreApiService.GetInventory ctx
return! (match result with
| GetInventoryDefaultStatusCode resolved ->
setStatusCode 200 >=> json resolved.content
| GetInventoryStatusCode200 resolved ->
setStatusCode 200 >=> json resolved.content
) next ctx
}
//#endregion
Expand All @@ -62,12 +62,12 @@ module StoreApiHandler =
let serviceArgs = { pathParams=pathParams; } : GetOrderByIdArgs
let result = StoreApiService.GetOrderById ctx serviceArgs
return! (match result with
| GetOrderByIdDefaultStatusCode resolved ->
setStatusCode 200 >=> json resolved.content
| GetOrderByIdStatusCode200 resolved ->
setStatusCode 200 >=> json resolved.content
| GetOrderByIdStatusCode400 resolved ->
setStatusCode 400 >=> text resolved.content
setStatusCode 400 >=> text resolved.content
| GetOrderByIdStatusCode404 resolved ->
setStatusCode 404 >=> text resolved.content
setStatusCode 404 >=> text resolved.content
) next ctx
}
//#endregion
Expand All @@ -85,10 +85,10 @@ module StoreApiHandler =
let serviceArgs = { bodyParams=bodyParams } : PlaceOrderArgs
let result = StoreApiService.PlaceOrder ctx serviceArgs
return! (match result with
| PlaceOrderDefaultStatusCode resolved ->
setStatusCode 200 >=> json resolved.content
| PlaceOrderStatusCode200 resolved ->
setStatusCode 200 >=> json resolved.content
| PlaceOrderStatusCode400 resolved ->
setStatusCode 400 >=> text resolved.content
setStatusCode 400 >=> text resolved.content
) next ctx
}
//#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ module StoreApiHandlerParams =
}


type GetInventoryDefaultStatusCodeResponse = {
type GetInventoryStatusCode200Response = {
content:IDictionary<string, int>;

}
type GetInventoryResult = GetInventoryDefaultStatusCode of GetInventoryDefaultStatusCodeResponse
type GetInventoryResult = GetInventoryStatusCode200 of GetInventoryStatusCode200Response

//#region Path parameters
[<CLIMutable>]
Expand All @@ -45,7 +45,7 @@ module StoreApiHandlerParams =
//#endregion


type GetOrderByIdDefaultStatusCodeResponse = {
type GetOrderByIdStatusCode200Response = {
content:Order;

}
Expand All @@ -59,7 +59,7 @@ module StoreApiHandlerParams =
content:string;

}
type GetOrderByIdResult = GetOrderByIdDefaultStatusCode of GetOrderByIdDefaultStatusCodeResponse|GetOrderByIdStatusCode400 of GetOrderByIdStatusCode400Response|GetOrderByIdStatusCode404 of GetOrderByIdStatusCode404Response
type GetOrderByIdResult = GetOrderByIdStatusCode200 of GetOrderByIdStatusCode200Response|GetOrderByIdStatusCode400 of GetOrderByIdStatusCode400Response|GetOrderByIdStatusCode404 of GetOrderByIdStatusCode404Response

type GetOrderByIdArgs = {
pathParams:GetOrderByIdPathParams;
Expand All @@ -71,7 +71,7 @@ module StoreApiHandlerParams =
//#endregion


type PlaceOrderDefaultStatusCodeResponse = {
type PlaceOrderStatusCode200Response = {
content:Order;

}
Expand All @@ -80,7 +80,7 @@ module StoreApiHandlerParams =
content:string;

}
type PlaceOrderResult = PlaceOrderDefaultStatusCode of PlaceOrderDefaultStatusCodeResponse|PlaceOrderStatusCode400 of PlaceOrderStatusCode400Response
type PlaceOrderResult = PlaceOrderStatusCode200 of PlaceOrderStatusCode200Response|PlaceOrderStatusCode400 of PlaceOrderStatusCode400Response

type PlaceOrderArgs = {
bodyParams:PlaceOrderBodyParams
Expand Down
Loading