Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move SnakeYAML log suppression to slightly earlier in the code path #6661

Merged
merged 1 commit into from
Apr 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions openapi/src/main/java/io/helidon/openapi/ParserHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ public class ParserHelper {

private ParserHelper(SnakeYAMLParserHelper<ExpandedTypeDescription> generatedHelper) {
this.generatedHelper = generatedHelper;
boolean warningsEnabled = Boolean.getBoolean("openapi.parsing.warnings.enabled");
if (SNAKE_YAML_INTROSPECTOR_LOGGER.isLoggable(java.util.logging.Level.WARNING) && !warningsEnabled) {
SNAKE_YAML_INTROSPECTOR_LOGGER.setLevel(java.util.logging.Level.SEVERE);
}
}

/**
Expand All @@ -58,6 +54,10 @@ private ParserHelper(SnakeYAMLParserHelper<ExpandedTypeDescription> generatedHel
* @return a new parser helper
*/
public static ParserHelper create() {
boolean warningsEnabled = Boolean.getBoolean("openapi.parsing.warnings.enabled");
if (SNAKE_YAML_INTROSPECTOR_LOGGER.isLoggable(java.util.logging.Level.WARNING) && !warningsEnabled) {
SNAKE_YAML_INTROSPECTOR_LOGGER.setLevel(java.util.logging.Level.SEVERE);
}
ParserHelper helper = new ParserHelper(SnakeYAMLParserHelper.create(ExpandedTypeDescription::create));
adjustTypeDescriptions(helper.types());
return helper;
Expand Down