This message was deleted.
# community-support
s
This message was deleted.
1
v
json not yaml, but this is what I do:
Copy code
val downloadNexusOpenApiSpec by tasks.registering {
    val nexusOpenApiSpecInput = resources
        .text
        .fromUri("<https://nexus.company.com/service/rest/swagger.json>")
        .asFile("UTF-8")

    inputs
        .file(nexusOpenApiSpecInput.absolutePath)
        .withPathSensitivity(NONE)
        .withPropertyName("nexusOpenApiSpec")

    val nexusOpenApiSpecOutput = layout.buildDirectory.file("nexusOpenApiSpec.json")
    outputs
        .file(nexusOpenApiSpecOutput)
        .withPropertyName("nexusOpenApiSpec")

    doLast {
        nexusOpenApiSpecOutput.get().asFile.writeBytes(nexusOpenApiSpecInput.readBytes())
    }
}
And then I can use the tasks output as input for other tasks like for openapi generator plugin
Copy code
inputSpec.set(downloadNexusOpenApiSpec.map {
    it.outputs.files.singleFile.absolutePath
})
s
Thanks @Vampire
👌 1