Skip to content

Commit

Permalink
Begin of OpenAPI Markdown Generator
Browse files Browse the repository at this point in the history
  • Loading branch information
isontheline committed Jun 11, 2024
1 parent fe0f16e commit f807be8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ openApi {
'http://localhost:1985/api/docs/app': 'swagger-app.json',
'http://localhost:1985/api/docs/rag': 'swagger-rag.json',
'http://localhost:1985/api/docs/raag': 'swagger-raag.json'])
outputDir.set(file("$buildDir/docs"))
outputDir.set(file("$buildDir/docs/api"))
waitTimeInSeconds.set(10)
customBootRun {
args.set(['--spring.profiles.active=test'])
Expand Down
19 changes: 18 additions & 1 deletion docs/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
plugins {
id "com.github.node-gradle.node" version "7.0.2"
id 'com.github.node-gradle.node' version '7.0.2'
id 'org.openapi.generator' version '7.5.0'
}

ext {
backendBuildDir = project(':backend').buildDir
}

task npmBuild(type: NpmTask) {
Expand All @@ -16,4 +21,16 @@ task test(type: NpmTask) {
inputs.dir("src")
outputs.dir("dist")
args = ['run', 'build']
}

task buildOpenApiMarkdownDocs(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
dependsOn(':backend:generateOpenApiDocs')
generatorName.set("markdown")
inputSpecRootDirectory.set("$backendBuildDir/docs/api")
cleanupOutput.set(true)
outputDir.set("$backendBuildDir/docs/api/markdown")
doLast {
delete "docs/api/specification"
file("$backendBuildDir/docs/api/markdown").renameTo(file("docs/api/specification"))
}
}

0 comments on commit f807be8

Please sign in to comment.