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

docs: initial gitbook docs #336

Merged
merged 35 commits into from
Sep 30, 2022
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
feelin lazy
  • Loading branch information
brizzbuzz committed Sep 30, 2022
commit 442e5e24fbf91a2e2fa96f2d258b4e699fdb917f
26 changes: 25 additions & 1 deletion docs/plugins/notarized_application.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,31 @@ reference [OpenAPI spec](https://spec.openapis.org/oas/v3.1.0) itself.

## Custom Routing

TODO
For public facing APIs, having the default endpoint exposed at `/openapi.json` is totally fine. However, if you need
more granular control over the route that exposes the generated schema, you can modify the `openApiJson` config value.

For example, if we want to hide our schema behind a basic auth check, we could do the following

```kotlin
private fun Application.mainModule() {
// Install content negotiation, auth, etc...
install(NotarizedApplication()) {
// ...
openApiJson = {
authenticate("basic") {
route("/openapi.json") {
get {
call.respond(
HttpStatusCode.OK,
[email protected][KompendiumAttributes.openApiSpec]
)
}
}
}
}
}
}
```

## Custom Types

Expand Down