mirror of
https://github.com/kestra-io/kestra.git
synced 2025-12-19 18:05:41 -05:00
feat: set version as Kestra version in openapi spec (#12932)
This commit is contained in:
@@ -47,3 +47,31 @@ dependencies {
|
||||
testImplementation("io.micronaut.sql:micronaut-jooq")
|
||||
}
|
||||
|
||||
tasks.register('updateOpenapiVersion') {
|
||||
dependsOn processResources
|
||||
|
||||
doLast {
|
||||
def openapiFilePath = "${buildDir}/classes/java/main/META-INF/swagger/kestra.yml"
|
||||
def openapiFile = file(openapiFilePath)
|
||||
|
||||
if (openapiFile.exists()) {
|
||||
def originalText = openapiFile.text
|
||||
def updatedText = originalText.replace('version: 1.0.0', "version: ${project.version}")
|
||||
|
||||
if (updatedText != originalText) {
|
||||
openapiFile.text = updatedText
|
||||
println "Successfully updated 'version' in $openapiFilePath to ${project.version}"
|
||||
} else {
|
||||
println "Warning: Did not find 'version: 1.0.0' to replace in $openapiFilePath. Check OpenAPI generator output."
|
||||
}
|
||||
} else {
|
||||
println "Error: OpenAPI file not found at $openapiFilePath. Skipping version update."
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
tasks.named('jar') {
|
||||
dependsOn updateOpenapiVersion
|
||||
}
|
||||
@@ -9,8 +9,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@OpenAPIDefinition(
|
||||
info = @Info(
|
||||
title = "Kestra",
|
||||
license = @License(name = "Apache 2.0", url = "https://raw.githubusercontent.com/kestra-io/kestra/master/LICENSE"),
|
||||
version = "v1"
|
||||
license = @License(name = "Apache 2.0", url = "https://raw.githubusercontent.com/kestra-io/kestra/master/LICENSE")
|
||||
),
|
||||
tags = {
|
||||
@Tag(name = "Flows", description = "Flows API"),
|
||||
|
||||
Reference in New Issue
Block a user