Skip to content

Commit f712e19

Browse files
committed
encoding/jsonschema: add metadata field to CRD test case
CRDs often declare the metadata field explicitly but do not explicitly define its subfields. We add a test case for this, so we can see the subsequent fix more clearly. For #3907 Signed-off-by: Roger Peppe <[email protected]> Change-Id: Id015ed86d09ce892a9ebdc5b20a6e434f1b3b49d Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1214625 Unity-Result: CUE porcuepine <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
1 parent aeb0747 commit f712e19

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

encoding/jsonschema/testdata/txtar/crd_embeddedresource.txtar

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@
2424
"openAPIV3Schema": {
2525
"type": "object",
2626
"properties": {
27+
"apiVersion": {
28+
"type": "string"
29+
},
30+
"kind": {
31+
"type": "string"
32+
},
33+
"metadata": {
34+
"type": "object"
35+
},
2736
"r1": {
2837
"type": "object",
2938
"x-kubernetes-embedded-resource": true,
@@ -46,6 +55,9 @@
4655
}
4756
}
4857
-- out/decode/extract --
58+
apiVersion?: string
59+
kind?: string
60+
metadata?: {}
4961
r1?: {
5062
_embeddedResource
5163
...

0 commit comments

Comments
 (0)