Skip to content

Commit

Permalink
continue to mark JsonAny field with x-kubernetes-preserve-unknown-fields
Browse files Browse the repository at this point in the history
  • Loading branch information
euberseder-hubspot committed May 1, 2024
1 parent b434dd6 commit 928f27f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ private T internalFromImpl(TypeDef definition, Set<String> visited, List<Interna
facade.pattern,
facade.nullable,
facade.required,
facade.preserveUnknownFields);
facade.preserveUnknownFields || facade.isJsonAny);

addProperty(possiblyRenamedProperty, builder, possiblyUpdatedSchema, options);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ void shouldProduceKubernetesPreserveFields() {
JSONSchemaProps fooField = spec.get("foo");

assertTrue(fooField.getXKubernetesPreserveUnknownFields());

Map<String, JSONSchemaProps> fooProperties = fooField.getProperties();
JSONSchemaProps configAsMapField = fooProperties.get("configAsMap");

assertNotNull(configAsMapField);
assertTrue(configAsMapField.getXKubernetesPreserveUnknownFields());
}

@Test
Expand Down

0 comments on commit 928f27f

Please sign in to comment.