File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed
crd-generator/api/src/main/java/io/fabric8/crd/generator/annotation Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 1818* Fix #4383 : bump snakeyaml from 1.30 to 1.31
1919
2020#### New Features
21+ * Feat: add annotation @PreserveUnknownFields for generation field
2122
2223#### _ ** Note** _ : Breaking changes in the API
2324* Fix #4350 : SchemaSwap's fieldName parameter now expects a field name only, not a method or a constructor.
Original file line number Diff line number Diff line change 11/**
2- * Copyright (C) 2022 Red Hat, Inc.
2+ * Copyright (C) 2015 Red Hat, Inc.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change @@ -359,6 +359,28 @@ Corresponding `x-kubernetes-preserve-unknown-fields: true` will be generated in
359359 x-kubernetes-preserve-unknown-fields: true
360360` ` `
361361
362+ You can also annotation a field with @PreserveUnknownFields :
363+
364+ ` ` ` java
365+ interface ExampleInterface {}
366+
367+ public class ExampleSpec {
368+ @PreserveUnknownFields
369+ ExampleInterface someValue;
370+ }
371+ ` ` `
372+
373+ will be generated as :
374+
375+ ` ` ` yaml
376+ spec:
377+ properties:
378+ someValue:
379+ type: object
380+ x-kubernetes-preserve-unknown-fields: true
381+ type: object
382+ ` ` `
383+
362384# # Features cheatsheet
363385
364386| Annotation | Description |
You can’t perform that action at this time.
0 commit comments