Skip to content

Generate OpenAPI descriptions in json and yaml formats without starting Spring Boot Application (Maven/Gradle) #1844

@lfvjimisola

Description

@lfvjimisola

Background

This topic has been up in forum (stack overflow).

The way the OpenAPI description file is generated is not intuitive ("I thought that the plugin would read though my source files and generate an openapi.json file.") and not ideal in CI/CD scenarios.

We are currently facing an obstacle when we not want to start the Spring Boot Application to generate our OpenAPI description file using springdoc-openapi-maven-plugin because we're using Spring Cloud Vault. We don't want our access tokens to the Vault to be available during build time - only when deployed.

Hence, when the Spring Boot Application starts it fails because of Spring Cloud Vault not being able to access the vault.
We've tried to set spring.cloud.vault.fail-fast=false but it still the same issue - the OpenAPI description file is not downloaded.

Question

Has there been some thoughts of a way to generate OpenAPI description without actually starting the Spring Boot Application, i.e. some sort of static generation?

Just like the user on StackOverflow expressed "I thought that the plugin would read though my source files and generate an openapi.json file."

I'm thinking that the way the OpenAPI description file is generated will cause problems if we want to create a Spring Boot Library that uses SpringDoc for OpenAPI. It's a library so it won't run standalone and hence no documentation can be generated (unless you create a mock application for just being able to generate the documentation).

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions