com.coreoz.openapi.config.OpenApiMergerConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of openapi-merger Show documentation
Show all versions of openapi-merger Show documentation
Merge multiple OpenAPI into a single spec
The newest version!
package com.coreoz.openapi.config;
import com.coreoz.http.routes.parsing.HttpRouteDefinition;
import org.jetbrains.annotations.NotNull;
import java.util.List;
/**
* @param routes
* @param componentNamePrefix The prefix that will be used for all new component name that will be added. This is used to avoid conflict with existing components
* @param operationIdPrefix Used if HttpEndpoint routeId is not present. The prefix that will be used for all new operation id that will be added. This is used to avoid conflict with existing operations
* @param createMissingRoutes True if routes present in the {@link #routes} and not in OpenAPI base definitions should be added or not
*/
public record OpenApiMergerConfiguration(
@NotNull List routes,
@NotNull OpenApiMergerConfigurationActions actions
) {
private static final OpenApiMergerConfiguration DEFAULT_CONFIGURATION = new OpenApiMergerConfiguration<>(List.of(), OpenApiMergerConfigurationActions.defaultActions());
public static OpenApiMergerConfiguration defaultConfig() {
//noinspection unchecked
return (OpenApiMergerConfiguration) DEFAULT_CONFIGURATION;
}
}