Skip to content

Commit c143b08

Browse files
authored
fixup api-docs (#121)
* fixup api-docs now contain the correct paths * add unit test
1 parent e0d4e85 commit c143b08

File tree

8 files changed

+121
-7
lines changed

8 files changed

+121
-7
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ private/
1717
http-client.private.env.json
1818
# Environment files should not be checked into git
1919
*.env.json
20+
21+
.direnv/
22+
.envrc

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ build-all: build-mvn build-docker ## Build all and create docker image
1010

1111
.PHONY: build-mvn
1212
build-mvn: ## Build project and install to you local maven repo
13-
./mvnw clean install -P ssb-bip
13+
mvn clean install -Dmaven.test.skip
1414

1515
.PHONY: build-docker
1616
build-docker: ## Build dev docker image
@@ -32,7 +32,7 @@ run-local: validate-local-config
3232

3333
.PHONY: release-dryrun
3434
release-dryrun: ## Simulate a release in order to detect any issues
35-
./mvnw release:prepare release:perform -Darguments="-Dmaven.deploy.skip=true" -DdryRun=true
35+
mvn release:prepare release:perform -Darguments="-Dmaven.deploy.skip=true" -DdryRun=true
3636

3737
.PHONY: release
3838
release: ## Release a new version. Update POMs and tag the new version in git

conf/application-local.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ micronaut:
22
application:
33
name: my-pseudo-service
44
server:
5+
host: 127.0.0.1
56
port: 10210
67
cors:
78
enabled: true

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
description = "Dapla pseudo service";
3+
4+
inputs = {
5+
flake-parts.url = "github:hercules-ci/flake-parts";
6+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
7+
};
8+
9+
outputs = inputs @ {flake-parts, ...}:
10+
flake-parts.lib.mkFlake {inherit inputs;} {
11+
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
12+
perSystem = {
13+
config,
14+
self',
15+
inputs',
16+
pkgs,
17+
system,
18+
...
19+
}: {
20+
devShells.default = pkgs.mkShell {
21+
name = "dapla-pseudo-service";
22+
packages = with pkgs; [gnumake maven openjdk];
23+
};
24+
formatter = pkgs.alejandra;
25+
};
26+
};
27+
}

openapi.properties

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
micronaut.openapi.views.spec = mapping.path=/,\
1+
micronaut.openapi.views.spec = \
2+
mapping.path=/api-docs/,\
23
swagger-ui.enabled=true,\
4+
swagger-ui.js.url=/api-docs/swagger-ui/res/,\
35
redoc.enabled=true,\
46
redoc.description=blah,\
5-
openapi-explorer.enabled=true,\
6-
rapidoc.enabled=true
7-
micronaut.openapi.server.context.path=/api-docs
7+
redoc.js.url=/api-docs/redoc/res/,\
8+
rapidoc.enabled=true,\
9+
rapidoc.js.url=/api-docs/rapidoc/res/,

src/main/java/no/ssb/dlp/pseudo/service/Application.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
title = "Dapla Pseudo Service",
1919
version = "1.0",
2020
description = "Endpoints that support pseudonymization and depseudonymization of data and datasets",
21-
contact = @Contact(url = "https://statistics-norway.atlassian.net/wiki/spaces/PSEUDO", name = "Team Skyinfrastruktur", email = "team-skyinfrastruktur@ssb.no")
21+
contact = @Contact(
22+
url = "https://statistics-norway.atlassian.net/wiki/spaces/PSEUDO",
23+
name = "Team Statistikktjenester",
24+
email = "team-statistikktjenester@ssb.no"
25+
)
2226
),
2327
security = @SecurityRequirement(name = "Keycloak token"),
2428
servers = {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package no.ssb.dlp.pseudo.service.docs;
2+
3+
import io.micronaut.core.io.ResourceLoader;
4+
import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
5+
import org.junit.jupiter.api.Test;
6+
7+
import static org.junit.jupiter.api.Assertions.assertTrue;
8+
9+
@MicronautTest(startApplication = false)
10+
class OpenApiGeneratedTest {
11+
12+
@Test
13+
void buildGeneratesOpenApi(ResourceLoader resourceLoader) {
14+
assertTrue(resourceLoader.getResource("META-INF/swagger/dapla-pseudo-service-1.0.yml").isPresent());
15+
}
16+
}

0 commit comments

Comments
 (0)