forked from loafle/openapi-generator-original
* cherry pick F# Functions generator test fix fix template paths replace giraffe sample * update doc
104 lines
3.2 KiB
Forth
104 lines
3.2 KiB
Forth
namespace OpenAPI.Tests
|
|
|
|
open System
|
|
open System.Net
|
|
open System.Net.Http
|
|
open System.IO
|
|
open Microsoft.AspNetCore.Builder
|
|
open Microsoft.AspNetCore.Hosting
|
|
open Microsoft.AspNetCore.TestHost
|
|
open Microsoft.Extensions.DependencyInjection
|
|
open FSharp.Control.Tasks.V2.ContextInsensitive
|
|
open Xunit
|
|
open System.Text
|
|
open TestHelper
|
|
open OpenAPI.UserApiHandler
|
|
open OpenAPI.UserApiHandlerParams
|
|
|
|
module UserApiHandlerTestsHelper =
|
|
|
|
|
|
let mutable CreateUserExamples = Map.empty
|
|
let mutable CreateUserBody = ""
|
|
|
|
CreateUserBody <- WebUtility.HtmlDecode "{
|
|
"firstName" : "firstName",
|
|
"lastName" : "lastName",
|
|
"password" : "password",
|
|
"userStatus" : 6,
|
|
"phone" : "phone",
|
|
"id" : 0,
|
|
"email" : "email",
|
|
"username" : "username"
|
|
}"
|
|
CreateUserExamples <- CreateUserExamples.Add("application/json", CreateUserBody)
|
|
|
|
let getCreateUserExample mediaType =
|
|
CreateUserExamples.[mediaType]
|
|
|> getConverter mediaType
|
|
|
|
let mutable CreateUsersWithArrayInputExamples = Map.empty
|
|
let mutable CreateUsersWithArrayInputBody = ""
|
|
|
|
CreateUsersWithArrayInputBody <- WebUtility.HtmlDecode "{
|
|
"firstName" : "firstName",
|
|
"lastName" : "lastName",
|
|
"password" : "password",
|
|
"userStatus" : 6,
|
|
"phone" : "phone",
|
|
"id" : 0,
|
|
"email" : "email",
|
|
"username" : "username"
|
|
}"
|
|
CreateUsersWithArrayInputExamples <- CreateUsersWithArrayInputExamples.Add("application/json", CreateUsersWithArrayInputBody)
|
|
|
|
let getCreateUsersWithArrayInputExample mediaType =
|
|
CreateUsersWithArrayInputExamples.[mediaType]
|
|
|> getConverter mediaType
|
|
|
|
let mutable CreateUsersWithListInputExamples = Map.empty
|
|
let mutable CreateUsersWithListInputBody = ""
|
|
|
|
CreateUsersWithListInputBody <- WebUtility.HtmlDecode "{
|
|
"firstName" : "firstName",
|
|
"lastName" : "lastName",
|
|
"password" : "password",
|
|
"userStatus" : 6,
|
|
"phone" : "phone",
|
|
"id" : 0,
|
|
"email" : "email",
|
|
"username" : "username"
|
|
}"
|
|
CreateUsersWithListInputExamples <- CreateUsersWithListInputExamples.Add("application/json", CreateUsersWithListInputBody)
|
|
|
|
let getCreateUsersWithListInputExample mediaType =
|
|
CreateUsersWithListInputExamples.[mediaType]
|
|
|> getConverter mediaType
|
|
()
|
|
|
|
()
|
|
|
|
()
|
|
|
|
()
|
|
|
|
|
|
let mutable UpdateUserExamples = Map.empty
|
|
let mutable UpdateUserBody = ""
|
|
|
|
UpdateUserBody <- WebUtility.HtmlDecode "{
|
|
"firstName" : "firstName",
|
|
"lastName" : "lastName",
|
|
"password" : "password",
|
|
"userStatus" : 6,
|
|
"phone" : "phone",
|
|
"id" : 0,
|
|
"email" : "email",
|
|
"username" : "username"
|
|
}"
|
|
UpdateUserExamples <- UpdateUserExamples.Add("application/json", UpdateUserBody)
|
|
|
|
let getUpdateUserExample mediaType =
|
|
UpdateUserExamples.[mediaType]
|
|
|> getConverter mediaType
|