Skip to content

Commit 66f5e1c

Browse files
rc-gleanCopilot
andauthored
Update modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent dbc42d3 commit 66f5e1c

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,14 @@ protected void normalizeProperties(Map<String, Schema> properties, Set<Schema> v
858858

859859
// remove x-internal if needed (same logic as normalizeComponentsSchemas)
860860
if (property.getExtensions() != null && getRule(REMOVE_X_INTERNAL)) {
861-
if (Boolean.parseBoolean(String.valueOf(property.getExtensions().get(X_INTERNAL)))) {
861+
Object xInternalValue = property.getExtensions().get(X_INTERNAL);
862+
boolean isInternal = false;
863+
if (xInternalValue instanceof Boolean) {
864+
isInternal = (Boolean) xInternalValue;
865+
} else if (xInternalValue instanceof String) {
866+
isInternal = Boolean.parseBoolean((String) xInternalValue);
867+
}
868+
if (isInternal) {
862869
property.getExtensions().remove(X_INTERNAL);
863870
}
864871
}

0 commit comments

Comments
 (0)