Skip to content

Commit 666a139

Browse files
winewaymanusa
authored andcommitted
add more explain for changelog & doc
Signed-off-by: wineway <[email protected]>
1 parent b65f154 commit 666a139

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* Fix #4383: bump snakeyaml from 1.30 to 1.31
1919

2020
#### New Features
21-
* Feat: add annotation @PreserveUnknownFields for generation field
21+
* Feat: add annotation @PreserveUnknownFields for marking generated field have `x-kubernetes-preserve-unknown-fields: true` defined
2222

2323
#### _**Note**_: Breaking changes in the API
2424
* Fix #4350: SchemaSwap's fieldName parameter now expects a field name only, not a method or a constructor.

crd-generator/api/src/main/java/io/fabric8/crd/generator/annotation/PreserveUnknownFields.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import java.lang.annotation.*;
1919

2020
/*
21-
* Used to tweak the behavior of the crd-generator
21+
* Used to emit 'x-kubernetes-preserve-unknown-fields'
2222
*/
2323
@Target(ElementType.FIELD)
2424
@Retention(RetentionPolicy.RUNTIME)

doc/CRD-generator.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -383,19 +383,20 @@ will be generated as:
383383

384384
## Features cheatsheet
385385

386-
| Annotation | Description |
387-
|-----------------------------------------------------------|---------------------------------------------------------------------------------------|
388-
| `com.fasterxml.jackson.annotation.JsonProperty` | The field is named after the provided value instead of looking up the java field name |
389-
| `com.fasterxml.jackson.annotation.JsonPropertyDescription`| The provided text is be embedded in the `description` of the field |
390-
| `com.fasterxml.jackson.annotation.JsonIgnore` | The field is ignored |
391-
| `com.fasterxml.jackson.annotation.JsonAnyGetter` | The corresponding object have `x-kubernetes-preserve-unknown-fields: true` defined |
392-
| `com.fasterxml.jackson.annotation.JsonAnySetter` | The corresponding object have `x-kubernetes-preserve-unknown-fields: true` defined |
393-
| `io.fabric8.generator.annotation.Min` | The field defines a validation `min` |
394-
| `io.fabric8.generator.annotation.Max` | The field defines a validation `max` |
395-
| `io.fabric8.generator.annotation.Pattern` | The field defines a validation `pattern` |
396-
| `io.fabric8.generator.annotation.Nullable` | The field is marked as `nullable` |
397-
| `io.fabric8.generator.annotation.Required` | The field is marked as `required` |
398-
| `io.fabric8.crd.generator.annotation.SchemaFrom` | The field type for the generation is the one coming from the annotation |
399-
| `io.fabric8.crd.generator.annotation.SchemaSwap` | Same as SchemaFrom, but can be applied at any point in the class hierarchy |
386+
| Annotation | Description |
387+
|--------------------------------------------------------------|---------------------------------------------------------------------------------------|
388+
| `com.fasterxml.jackson.annotation.JsonProperty` | The field is named after the provided value instead of looking up the java field name |
389+
| `com.fasterxml.jackson.annotation.JsonPropertyDescription` | The provided text is be embedded in the `description` of the field |
390+
| `com.fasterxml.jackson.annotation.JsonIgnore` | The field is ignored |
391+
| `io.fabric8.crd.generator.annotation.PreserveUnknownFields` | The field have `x-kubernetes-preserve-unknown-fields: true` defined |
392+
| `com.fasterxml.jackson.annotation.JsonAnyGetter` | The corresponding object have `x-kubernetes-preserve-unknown-fields: true` defined |
393+
| `com.fasterxml.jackson.annotation.JsonAnySetter` | The corresponding object have `x-kubernetes-preserve-unknown-fields: true` defined |
394+
| `io.fabric8.generator.annotation.Min` | The field defines a validation `min` |
395+
| `io.fabric8.generator.annotation.Max` | The field defines a validation `max` |
396+
| `io.fabric8.generator.annotation.Pattern` | The field defines a validation `pattern` |
397+
| `io.fabric8.generator.annotation.Nullable` | The field is marked as `nullable` |
398+
| `io.fabric8.generator.annotation.Required` | The field is marked as `required` |
399+
| `io.fabric8.crd.generator.annotation.SchemaFrom` | The field type for the generation is the one coming from the annotation |
400+
| `io.fabric8.crd.generator.annotation.SchemaSwap` | Same as SchemaFrom, but can be applied at any point in the class hierarchy |
400401

401402
A field of type `com.fasterxml.jackson.databind.JsonNode` is encoded as an empty object with `x-kubernetes-preserve-unknown-fields: true` defined.

0 commit comments

Comments
 (0)