Skip to content

Commit

Permalink
feat(webserver): small improvements to our OpenAPI spec
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu committed Dec 16, 2024
1 parent 2d4fb76 commit 6a34c04
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion webserver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ configurations {
dependencies {

annotationProcessor "io.micronaut.openapi:micronaut-openapi"
implementation "io.swagger.core.v3:swagger-annotations"
compileOnly "io.micronaut.openapi:micronaut-openapi-annotations"

annotationProcessor project(':processor')
implementation project(":core")
Expand Down
4 changes: 2 additions & 2 deletions webserver/src/main/java/io/kestra/webserver/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
@OpenAPIDefinition(
info = @Info(
title = "Kestra",
license = @License(name = "Apache 2.0", url = "https://raw.githubusercontent.com/kestra-io/kestra/master/LICENSE")
license = @License(name = "Apache 2.0", url = "https://raw.githubusercontent.com/kestra-io/kestra/master/LICENSE"),
version = "v1"
),
tags = {
@Tag(name = "Flows", description = "Flows API"),
Expand All @@ -20,7 +21,6 @@
@Tag(name = "Stats", description = "Stats API"),
@Tag(name = "Misc", description = "Misc API"),
@Tag(name = "Blueprints", description = "Blueprints API"),
@Tag(name = "Blueprint Tags", description = "Blueprint Tags API"),
@Tag(name = "Metrics", description = "Metrics API"),
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@
import io.micronaut.scheduling.TaskExecutors;
import io.micronaut.scheduling.annotation.ExecuteOn;
import io.micronaut.validation.Validated;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.extensions.Extension;
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import jakarta.inject.Inject;
Expand Down Expand Up @@ -260,6 +263,7 @@ public HttpResponse<FlowWithSource> create(
@Post(consumes = MediaType.ALL)
@Operation(tags = {"Flows"}, summary = "Create a flow from json object", deprecated = true)
@Deprecated(forRemoval = true, since = "0.18")
@Hidden // we hide it otherwise this is the one that will be included in the OpenAPI spec instead of the YAML one.
public HttpResponse<Flow> create(
@Parameter(description = "The flow") @Body Flow flow
) throws ConstraintViolationException {
Expand Down Expand Up @@ -310,6 +314,7 @@ public List<FlowWithSource> updateNamespace(
deprecated = true
)
@Deprecated(forRemoval = true, since = "0.18")
@Hidden // we hide it otherwise this is the one that will be included in the OpenAPI spec instead of the YAML one.
public List<Flow> updateNamespace(
@Parameter(description = "The flow namespace") @PathVariable String namespace,
@Parameter(description = "A list of flows") @Body @Valid List<Flow> flows,
Expand Down Expand Up @@ -431,6 +436,7 @@ public HttpResponse<FlowWithSource> update(
@ExecuteOn(TaskExecutors.IO)
@Operation(tags = {"Flows"}, summary = "Update a flow", deprecated = true)
@Deprecated(forRemoval = true, since = "0.18")
@Hidden // we hide it otherwise this is the one that will be included in the OpenAPI spec instead of the JSON one.
public HttpResponse<Flow> update(
@Parameter(description = "The flow namespace") @PathVariable String namespace,
@Parameter(description = "The flow id") @PathVariable String id,
Expand Down

0 comments on commit 6a34c04

Please sign in to comment.