Commit b199901
[fix] Apply REMOVE_X_INTERNAL normalizer to nested inline properties (#22097)
* fix: Apply REMOVE_X_INTERNAL normalizer to nested inline properties
When REMOVE_X_INTERNAL=true is set, the normalizer removes the x-internal
extension from top-level schemas in components/schemas but fails to remove
it from inline object properties within those schemas.
This causes issues when:
1. A schema is imported cross-file (e.g., admin.yaml imports from chat.yaml)
2. That schema has an inline object property with x-internal: true
3. The inline property has type: object with nested properties
Result: TypeScript generator creates a type reference but no interface
definition, causing compilation errors.
This fix applies the same x-internal removal logic to normalizeProperties()
that already exists in normalizeComponentsSchemas(), ensuring inline
properties are handled consistently.
Fixes behavior for inline schemas with x-internal in cross-file imports.
* Update modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java
Co-authored-by: Copilot <[email protected]>
* test: Add test case for REMOVE_X_INTERNAL with inline properties
Adds test to verify that REMOVE_X_INTERNAL normalizer correctly removes
x-internal extension from inline object properties, not just top-level schemas.
* Apply suggestion from @Copilot
Co-authored-by: Copilot <[email protected]>
* Revert "Apply suggestion from @Copilot"
This reverts commit c899e9e.
---------
Co-authored-by: Copilot <[email protected]>1 parent 941a5cc commit b199901
File tree
3 files changed
+74
-0
lines changed- modules/openapi-generator/src
- main/java/org/openapitools/codegen
- test
- java/org/openapitools/codegen
- resources/3_0
3 files changed
+74
-0
lines changedLines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
855 | 855 | | |
856 | 856 | | |
857 | 857 | | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
858 | 872 | | |
859 | 873 | | |
860 | 874 | | |
| |||
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1153 | 1153 | | |
1154 | 1154 | | |
1155 | 1155 | | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
1156 | 1192 | | |
1157 | 1193 | | |
1158 | 1194 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
0 commit comments