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

chore: added swagger #282

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ Remember to change the environment variables, to match your local services
docker run --rm -it -p 8080:8080 -e "LEGE_SUSPENSJON_PROXY_ENDPOINT_URL=https://localhost:8081" -e "LEGE_SUSPENSJON_PROXY_SCOPE=localhost" -e "SYKETILLFELLE_SCOPE=localhost" -e "HELSENETT_ENDPOINT_URL=https://localhost:8081" -e "AZURE_OPENID_CONFIG_TOKEN_ENDPOINT=https://localhost:8081" -e "AZURE_APP_CLIENT_ID=localhost" -e "AZURE_APP_CLIENT_SECRET=localhost" -e "HELSENETT_SCOPE=localhost" -e "SMREGISTER_AUDIENCE=localhost" -e "PDL_SCOPE=localhost" -e "PDL_GRAPHQL_PATH=https://localhost:8081/graphql" -e "AZURE_OPENID_CONFIG_ISSUER=localhost" -e "AZURE_OPENID_CONFIG_JWKS_URI=https://localhost:8081" -e "KAFKA_BROKERS=https://localhost:8081" -e "KAFKA_TRUSTSTORE_PATH=super/secret/test.cert" -e "KAFKA_KEYSTORE_PATH=super/secret/private/test.cert" -e "KAFKA_CREDSTORE_PASSWORD=password" syfosmregler
```

#### Api doc
https://syfosmregler.intern.dev.nav.no/openapi

### Upgrading the gradle wrapper
Find the newest version of gradle here: https://gradle.org/releases/ Then run this command:
Expand Down
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ dependencies {
implementation("io.ktor:ktor-serialization-jackson:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-client-apache:$ktorVersion")
implementation("io.ktor:ktor-server-swagger:$ktorVersion")



implementation("no.nav.helse:diagnosekoder:$diagnosekoderVersion")
Expand Down
2 changes: 2 additions & 0 deletions naiserator-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ spec:
pool: nav-dev
secureLogs:
enabled: true
ingresses:
- "https://syfosmregler.intern.dev.nav.no"
env:
- name: HELSENETT_SCOPE
value: api://dev-gcp.teamsykmelding.syfohelsenettproxy/.default
Expand Down
2 changes: 2 additions & 0 deletions src/main/kotlin/no/nav/syfo/Application.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import no.nav.syfo.nais.isready.naisIsReadyRoute
import no.nav.syfo.nais.prometheus.naisPrometheusRoute
import no.nav.syfo.pdl.client.PdlClient
import no.nav.syfo.pdl.service.PdlPersonService
import no.nav.syfo.rules.api.configureSwagger
import no.nav.syfo.rules.api.registerRuleApi
import no.nav.syfo.services.JuridiskVurderingService
import no.nav.syfo.services.RuleExecutionService
Expand Down Expand Up @@ -93,6 +94,7 @@ fun Application.configureRouting(
naisIsReadyRoute(applicationState)
naisPrometheusRoute()
authenticate("servicebrukerAAD") { registerRuleApi(ruleService) }
configureSwagger()
}
install(ContentNegotiation) {
jackson {
Expand Down
1 change: 0 additions & 1 deletion src/main/kotlin/no/nav/syfo/rules/api/RuleApi.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package no.nav.syfo.rules.api

import io.ktor.server.application.call
import io.ktor.server.request.receive
import io.ktor.server.response.respond
import io.ktor.server.routing.Route
Expand Down
9 changes: 9 additions & 0 deletions src/main/kotlin/no/nav/syfo/rules/api/Swagger.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package no.nav.syfo.rules.api

import io.ktor.server.application.Application
import io.ktor.server.plugins.swagger.swaggerUI
import io.ktor.server.routing.routing

fun Application.configureSwagger() {
routing { swaggerUI(path = "openapi", swaggerFile = "openapi/documentation.yaml") }
}
Loading
Loading