Open BashkaMen opened 3 years ago
Hi @BashkaMen thanks for filing the issue! It seems like we haven't accounted for this use case 🤔 I need to think about it because even if you expose the docs as a separate API, clients won't be able to call the docs functions unless you are authenticated too
Do you have any suggestions on how to go about this? We could add an additional text field in the generated docs to specify the authorization header or cookie. Maybe that could work 🤔
let apiDocs =
let docs = Docs.createFor<Api>()
Remoting.documentation "Client api" [
docs.route <@ fun api -> api.GetInfo @>
|> docs.alias "Get client info"
|> docs.example <@ fun api -> api.GetInfo @>
|> docs.example <@ fun api -> api.GetInfo @>
|> docs.withHeaders "Authorization" "Bearer Token"
]
this would be enough for me
I will try to make a pull request
can i create pull request?
can i create pull request?
Pull requests are more than welcome! 🙏
We could add an additional text field in the generated docs to specify the authorization header or cookie. Maybe that could work 🤔
fwiw, that's sort of what SwaggerUI allows -
I used it in a project at work once that required a type of licence to be passed in order to be able to call the functions, and that lets you enter the key once and then call multiple other functions without needing it seperately
Hello, it is my app
both remoting has docs, but i can open docs only for AuthRemoting maybe i can create docs page as separate api?