Skip to content

Commit 8d2710f

Browse files
committed
try harder
1 parent fb8c242 commit 8d2710f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/types.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,12 @@ impl JsonSchema for HeaderValue {
7272
}
7373

7474
fn json_schema(_generator: &mut SchemaGenerator) -> Schema {
75-
// Kubernetes structural schemas forbid `type` inside `anyOf` items,
76-
// so we emit the branches without top-level `type`.
75+
// Kubernetes structural schemas require `type` on `additionalProperties`,
76+
// but HeaderValue is a string-or-object union so no single type works.
77+
// `x-kubernetes-preserve-unknown-fields` exempts us from that requirement.
78+
// The `anyOf` items must not set `type` (structural schema rule).
7779
json_schema!({
80+
"x-kubernetes-preserve-unknown-fields": true,
7881
"anyOf": [
7982
{},
8083
{

0 commit comments

Comments
 (0)