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
Show file tree
Hide file tree
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 95ffa81d12cccfcd29851ba787d2cf5b5726e938
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import io.bkbn.kompendium.core.metadata.PutInfo
import io.bkbn.kompendium.core.plugin.NotarizedRoute
import io.bkbn.kompendium.json.schema.definition.TypeDefinition
import io.bkbn.kompendium.oas.payload.Parameter
import io.kotest.engine.extensions.SystemPropertyTagExtension.tags
import io.ktor.http.HttpStatusCode
import io.ktor.server.application.call
import io.ktor.server.application.install
Expand Down Expand Up @@ -77,6 +78,7 @@ object TestModules {
route(defaultPath) {
install(NotarizedRoute()) {
parameters = defaultParams
tags = setOf()
get = GetInfo.builder {
response {
responseCode(HttpStatusCode.OK)
Expand Down
33 changes: 32 additions & 1 deletion docs/plugins/notarized_route.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,39 @@ install(NotarizedRoute()) {

## Operation Tags

Operation tags work much like route tags, except they only apply to the operation they are defined in.
Operation tags work much like route tags, except they only apply to the operation they are defined in. They are defined
slightly differently, as a function on the builder, rather than an instance variable directly.

```kotlin
install(NotarizedRoute()) {
get = GetInfo.builder {
tags("User")
// ...
}
}
```

## Operation Parameters

Operation parameters work much like route parameters, except they only apply to the operation they are defined in. They
are defined slightly differently, as a function on the builder, rather than an instance variable directly.

```kotlin
install(NotarizedRoute()) {
parameters(
Parameter(
name = "a",
`in` = Parameter.Location.path,
schema = TypeDefinition.STRING,
),
Parameter(
name = "aa",
`in` = Parameter.Location.query,
schema = TypeDefinition.INT
)
)
// ...
}
```

## Defining Request and Response Bodies
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ private fun Route.documentation() {
)
get = GetInfo.builder {
tags("")
parameters()
summary("Get user by id")
description("A very neat endpoint!")
response {
Expand Down