Skip to content
Discussion options

You must be logged in to vote

Once again, I figured out the answer shortly after asking the question.

I was able to accomplish this using the following code in my OpenAPI transformation function:

fn transform_openapi(openapi: TransformOpenApi) -> TransformOpenApi {
    let api_version_prefix: String = format!("/{API_VERSION}");

    let mut openapi = openapi
        .title(PROGRAM_PROPER_NAME)
        .summary(env!("CARGO_PKG_DESCRIPTION"))
        .version(env!("CARGO_PKG_VERSION"))
        .server(Server {
            url: api_version_prefix.clone(),
            description: Some(format!("API {API_VERSION}.")),
            variables: IndexMap::default(),
            extensions: IndexMap::default(),
        });

    /…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zedseven
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant