-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
Using Fable.Remoting.Suave v4.43.0, the embedded docs application doesn't work.
Repro:
open Fable.Remoting.Suave
open Suave
type ToolApi = {
hello: unit -> Async<string>
}
let toolApi: ToolApi = {
hello = fun () -> async { return "Hello from the tool API" }
}
let docs = Remoting.documentation "Tool API" [ ]
let toolApiHandler =
Remoting.createApi()
|> Remoting.fromValue toolApi
|> Remoting.withDocs "/api/docs" docs
|> Remoting.buildWebPart
startWebServer defaultConfig toolApiHandlerThis spins up a web server at localhost:8080, then navigating to localhost:8080/api/docs shows the following
The problem is that requesting the schema via OPTIONS http://localhost:8080/api/docs/$schema returns a double JSON-ified schema information:
"{\"name\":\"Tool API\",\"routes\":[{\"remoteFunction\":\"hello\",\"httpMethod\":\"GET\",\"route\":\"/ToolApi/hello\",\"description\":\"\",\"alias\":\"hello\",\"examples\":[]}]}"rather than
{"name":"Tool API","routes":[{"remoteFunction":"hello","httpMethod":"GET","route":"/ToolApi/hello","description":"","alias":"hello","examples":[]}]}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels