Skip to content

Commit c899e9e

Browse files
rc-gleanCopilot
andauthored
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 435b942 commit c899e9e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -864,10 +864,9 @@ protected void normalizeProperties(Map<String, Schema> properties, Set<Schema> v
864864
isInternal = (Boolean) xInternalValue;
865865
} else if (xInternalValue instanceof String) {
866866
isInternal = Boolean.parseBoolean((String) xInternalValue);
867-
}
868-
if (isInternal) {
869-
property.getExtensions().remove(X_INTERNAL);
870-
}
867+
if (property.getExtensions() != null && getRule(REMOVE_X_INTERNAL)
868+
&& Boolean.parseBoolean(String.valueOf(property.getExtensions().get(X_INTERNAL)))) {
869+
property.getExtensions().remove(X_INTERNAL);
871870
}
872871
Schema newProperty = normalizeSchema(property, new HashSet<>());
873872
propertiesEntry.setValue(newProperty);

0 commit comments

Comments
 (0)