Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ public void execute() throws MojoExecutionException {
inputSpecRootDirectory = inputSpecRootDirectory.replaceAll("\\\\", "/");

inputSpec = new MergedSpecBuilder(inputSpecRootDirectory, mergedFileName,
mergedFileInfoName, mergedFileInfoDescription, mergedFileInfoVersion)
mergedFileInfoName, mergedFileInfoDescription, mergedFileInfoVersion, auth)
.buildMergedSpec();
LOGGER.info("Merge input spec would be used - {}", inputSpec);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.swagger.parser.OpenAPIParser;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.parser.core.models.ParseOptions;
import org.openapitools.codegen.auth.AuthParser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -28,18 +29,20 @@ public class MergedSpecBuilder {
private final String mergedFileInfoName;
private final String mergedFileInfoDescription;
private final String mergedFileInfoVersion;
private final String auth;

public MergedSpecBuilder(final String rootDirectory, final String mergeFileName) {
this(rootDirectory, mergeFileName, "merged spec", "merged spec", "1.0.0");
this(rootDirectory, mergeFileName, "merged spec", "merged spec", "1.0.0", null);
}

public MergedSpecBuilder(final String rootDirectory, final String mergeFileName,
final String mergedFileInfoName, final String mergedFileInfoDescription, final String mergedFileInfoVersion) {
final String mergedFileInfoName, final String mergedFileInfoDescription, final String mergedFileInfoVersion, final String auth) {
this.inputSpecRootDirectory = rootDirectory;
this.mergeFileName = mergeFileName;
this.mergedFileInfoName = mergedFileInfoName;
this.mergedFileInfoDescription = mergedFileInfoDescription;
this.mergedFileInfoVersion = mergedFileInfoVersion;
this.auth = auth;
}

public String buildMergedSpec() {
Expand All @@ -62,7 +65,7 @@ public String buildMergedSpec() {
LOGGER.info("Reading spec: {}", specPath);

OpenAPI result = new OpenAPIParser()
.readLocation(specPath, new ArrayList<>(), options)
.readLocation(specPath, AuthParser.parse(auth), options)
.getOpenAPI();

if (openapiVersion == null) {
Expand Down
Loading