Skip to content

Commit

Permalink
#129: Recursive exception when comparing swagger files
Browse files Browse the repository at this point in the history
  • Loading branch information
galovics committed May 14, 2024
1 parent a71ff1e commit 17783b4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions swagger-brake-integration-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ dependencies {
testImplementation "ch.qos.logback:logback-core:1.2.11"
testImplementation "ch.qos.logback:logback-classic:1.2.11"
testImplementation "org.awaitility:awaitility:4.2.0"
testImplementation "org.seleniumhq.selenium:selenium-java:4.14.1"
testImplementation "org.seleniumhq.selenium:selenium-chrome-driver:4.14.1"
testImplementation "org.seleniumhq.selenium:selenium-java:4.20.0"
testImplementation "org.seleniumhq.selenium:selenium-chrome-driver:4.20.0"
testImplementation "io.github.bonigarcia:webdrivermanager:5.6.0"
testImplementation "org.testcontainers:testcontainers:1.19.1"
testImplementation "org.apache.httpcomponents:httpclient:4.5.14"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
public class WebDriverFactory {
private static final String CHROME_DRIVER_VERSION_ENV_VAR = "CHROME_DRIVER_VERSION";
private static final String CHROME_BROWSER_VERSION_ENV_VAR = "CHROME_BROWSER_VERSION";
public static final String DEFAULT_DRIVER_VERSION = "117.0.5938.132";
public static final String DEFAULT_BROWSER_VERSION = "117.0.5938.132";
public static final String DEFAULT_DRIVER_VERSION = "124.0.6367.207";
public static final String DEFAULT_BROWSER_VERSION = "124.0.6367.208";

public static WebDriver create() {
WebDriverManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package io.redskap.swagger.brake.core.model.store;

import io.swagger.v3.oas.models.media.Schema;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Supplier;

import io.swagger.v3.oas.models.media.Schema;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
Expand All @@ -18,6 +17,12 @@ public Optional<Schema> getNative(String name) {
}

public Optional<io.redskap.swagger.brake.core.model.Schema> getTransformer(String name, Supplier<io.redskap.swagger.brake.core.model.Schema> provider) {
return Optional.ofNullable(transformerSchemas.computeIfAbsent(name, (k) -> provider.get()));
if (!transformerSchemas.containsKey(name)){
io.redskap.swagger.brake.core.model.Schema schema = provider.get();
transformerSchemas.put(name, schema);
}

return Optional.ofNullable(transformerSchemas.get(name));

}
}

0 comments on commit 17783b4

Please sign in to comment.