{
    "kind": "CustomResourceDefinition",
    "apiVersion": "apiextensions.k8s.io/v1",
    "metadata": {
        "name": "testkinds.testapp.ext.grafana.app"
    },
    "spec": {
        "group": "testapp.ext.grafana.app",
        "versions": [
            {
                "name": "v1",
                "served": true,
                "storage": true,
                "schema": {
                    "openAPIV3Schema": {
                        "properties": {
                            "spec": {
                                "properties": {
                                    "stringField": {
                                        "pattern": "^[a-zA-Z_][a-zA-Z0-9_-]*$",
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "stringField"
                                ],
                                "type": "object"
                            },
                            "status": {
                                "properties": {
                                    "additionalFields": {
                                        "description": "additionalFields is reserved for future use",
                                        "type": "object",
                                        "x-kubernetes-preserve-unknown-fields": true
                                    },
                                    "operatorStates": {
                                        "additionalProperties": {
                                            "properties": {
                                                "descriptiveState": {
                                                    "description": "descriptiveState is an optional more descriptive state field which has no requirements on format",
                                                    "type": "string"
                                                },
                                                "details": {
                                                    "description": "details contains any extra information that is operator-specific",
                                                    "type": "object",
                                                    "x-kubernetes-preserve-unknown-fields": true
                                                },
                                                "lastEvaluation": {
                                                    "description": "lastEvaluation is the ResourceVersion last evaluated",
                                                    "type": "string"
                                                },
                                                "state": {
                                                    "description": "state describes the state of the lastEvaluation.\nIt is limited to three possible states for machine evaluation.",
                                                    "enum": [
                                                        "success",
                                                        "in_progress",
                                                        "failed"
                                                    ],
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "lastEvaluation",
                                                "state"
                                            ],
                                            "type": "object"
                                        },
                                        "description": "operatorStates is a map of operator ID to operator state evaluations.\nAny operator which consumes this kind SHOULD add its state evaluation information to this field.",
                                        "type": "object"
                                    }
                                },
                                "type": "object"
                            }
                        },
                        "required": [
                            "spec"
                        ],
                        "type": "object"
                    }
                },
                "subresources": {
                    "status": {}
                },
                "selectableFields": [
                    {
                        "jsonPath": ".spec.stringField"
                    }
                ]
            },
            {
                "name": "v2",
                "served": true,
                "storage": false,
                "schema": {
                    "openAPIV3Schema": {
                        "properties": {
                            "spec": {
                                "properties": {
                                    "intField": {
                                        "type": "integer"
                                    },
                                    "stringField": {
                                        "type": "string"
                                    },
                                    "timeField": {
                                        "format": "date-time",
                                        "type": "string"
                                    },
                                    "unionNull": {
                                        "allOf": [
                                            {
                                                "required": [
                                                    "str",
                                                    "i"
                                                ]
                                            }
                                        ],
                                        "description": "This generates a normal go pointer field, but needs to be handled correctly as a selectable field, as the schema logic registers it as a disjunction",
                                        "nullable": true,
                                        "properties": {
                                            "i": {
                                                "type": "integer"
                                            },
                                            "str": {
                                                "type": "string"
                                            }
                                        },
                                        "type": "object"
                                    },
                                    "unionNull2": {
                                        "description": "null variant should be ignore in disjunction when generating the selectable field",
                                        "oneOf": [
                                            {
                                                "not": {
                                                    "anyOf": [
                                                        {
                                                            "required": [
                                                                "b"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                "required": [
                                                    "str",
                                                    "i"
                                                ]
                                            },
                                            {
                                                "not": {
                                                    "anyOf": [
                                                        {
                                                            "required": [
                                                                "i"
                                                            ]
                                                        }
                                                    ]
                                                },
                                                "required": [
                                                    "str",
                                                    "b"
                                                ]
                                            },
                                            {
                                                "not": {
                                                    "anyOf": [
                                                        {
                                                            "required": [
                                                                "str"
                                                            ]
                                                        },
                                                        {
                                                            "required": [
                                                                "i"
                                                            ]
                                                        },
                                                        {
                                                            "required": [
                                                                "str"
                                                            ]
                                                        },
                                                        {
                                                            "required": [
                                                                "b"
                                                            ]
                                                        }
                                                    ]
                                                }
                                            }
                                        ],
                                        "properties": {
                                            "b": {
                                                "type": "boolean"
                                            },
                                            "i": {
                                                "type": "integer"
                                            },
                                            "str": {
                                                "type": "string"
                                            }
                                        },
                                        "type": [
                                            "object",
                                            "null"
                                        ]
                                    }
                                },
                                "required": [
                                    "stringField",
                                    "intField",
                                    "timeField"
                                ],
                                "type": "object"
                            },
                            "status": {
                                "properties": {
                                    "additionalFields": {
                                        "description": "additionalFields is reserved for future use",
                                        "type": "object",
                                        "x-kubernetes-preserve-unknown-fields": true
                                    },
                                    "operatorStates": {
                                        "additionalProperties": {
                                            "properties": {
                                                "descriptiveState": {
                                                    "description": "descriptiveState is an optional more descriptive state field which has no requirements on format",
                                                    "type": "string"
                                                },
                                                "details": {
                                                    "description": "details contains any extra information that is operator-specific",
                                                    "type": "object",
                                                    "x-kubernetes-preserve-unknown-fields": true
                                                },
                                                "lastEvaluation": {
                                                    "description": "lastEvaluation is the ResourceVersion last evaluated",
                                                    "type": "string"
                                                },
                                                "state": {
                                                    "description": "state describes the state of the lastEvaluation.\nIt is limited to three possible states for machine evaluation.",
                                                    "enum": [
                                                        "success",
                                                        "in_progress",
                                                        "failed"
                                                    ],
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "lastEvaluation",
                                                "state"
                                            ],
                                            "type": "object"
                                        },
                                        "description": "operatorStates is a map of operator ID to operator state evaluations.\nAny operator which consumes this kind SHOULD add its state evaluation information to this field.",
                                        "type": "object"
                                    }
                                },
                                "type": "object"
                            }
                        },
                        "required": [
                            "spec"
                        ],
                        "type": "object"
                    }
                },
                "subresources": {
                    "status": {}
                },
                "selectableFields": [
                    {
                        "jsonPath": ".spec.stringField"
                    },
                    {
                        "jsonPath": ".spec.intField"
                    },
                    {
                        "jsonPath": ".spec.unionNull.str"
                    },
                    {
                        "jsonPath": ".spec.unionNull2.str"
                    }
                ],
                "additionalPrinterColumns": [
                    {
                        "name": "STRING FIELD",
                        "type": "string",
                        "jsonPath": ".spec.stringField"
                    }
                ]
            },
            {
                "name": "v3",
                "served": true,
                "storage": false,
                "schema": {
                    "openAPIV3Schema": {
                        "properties": {
                            "spec": {
                                "properties": {
                                    "boolField": {
                                        "type": "boolean"
                                    },
                                    "intField": {
                                        "type": "integer"
                                    },
                                    "stringField": {
                                        "type": "string"
                                    },
                                    "timeField": {
                                        "format": "date-time",
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "stringField",
                                    "intField",
                                    "timeField",
                                    "boolField"
                                ],
                                "type": "object"
                            },
                            "status": {
                                "properties": {
                                    "additionalFields": {
                                        "description": "additionalFields is reserved for future use",
                                        "type": "object",
                                        "x-kubernetes-preserve-unknown-fields": true
                                    },
                                    "operatorStates": {
                                        "additionalProperties": {
                                            "properties": {
                                                "descriptiveState": {
                                                    "description": "descriptiveState is an optional more descriptive state field which has no requirements on format",
                                                    "type": "string"
                                                },
                                                "details": {
                                                    "description": "details contains any extra information that is operator-specific",
                                                    "type": "object",
                                                    "x-kubernetes-preserve-unknown-fields": true
                                                },
                                                "lastEvaluation": {
                                                    "description": "lastEvaluation is the ResourceVersion last evaluated",
                                                    "type": "string"
                                                },
                                                "state": {
                                                    "description": "state describes the state of the lastEvaluation.\nIt is limited to three possible states for machine evaluation.",
                                                    "enum": [
                                                        "success",
                                                        "in_progress",
                                                        "failed"
                                                    ],
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "lastEvaluation",
                                                "state"
                                            ],
                                            "type": "object"
                                        },
                                        "description": "operatorStates is a map of operator ID to operator state evaluations.\nAny operator which consumes this kind SHOULD add its state evaluation information to this field.",
                                        "type": "object"
                                    }
                                },
                                "type": "object"
                            }
                        },
                        "required": [
                            "spec"
                        ],
                        "type": "object"
                    }
                },
                "subresources": {
                    "status": {}
                },
                "selectableFields": [
                    {
                        "jsonPath": ".spec.stringField"
                    },
                    {
                        "jsonPath": ".spec.intField"
                    },
                    {
                        "jsonPath": ".spec.boolField"
                    }
                ]
            },
            {
                "name": "v4",
                "served": true,
                "storage": false,
                "schema": {
                    "openAPIV3Schema": {
                        "properties": {
                            "spec": {
                                "properties": {
                                    "union": {
                                        "oneOf": [
                                            {
                                                "required": [
                                                    "kind",
                                                    "spec"
                                                ]
                                            },
                                            {
                                                "required": [
                                                    "kind",
                                                    "spec"
                                                ]
                                            }
                                        ],
                                        "properties": {
                                            "kind": {
                                                "type": "string"
                                            },
                                            "spec": {
                                                "properties": {
                                                    "name": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "name"
                                                ],
                                                "type": "object"
                                            }
                                        },
                                        "type": "object"
                                    }
                                },
                                "required": [
                                    "union"
                                ],
                                "type": "object"
                            },
                            "status": {
                                "properties": {
                                    "additionalFields": {
                                        "description": "additionalFields is reserved for future use",
                                        "type": "object",
                                        "x-kubernetes-preserve-unknown-fields": true
                                    },
                                    "operatorStates": {
                                        "additionalProperties": {
                                            "properties": {
                                                "descriptiveState": {
                                                    "description": "descriptiveState is an optional more descriptive state field which has no requirements on format",
                                                    "type": "string"
                                                },
                                                "details": {
                                                    "description": "details contains any extra information that is operator-specific",
                                                    "type": "object",
                                                    "x-kubernetes-preserve-unknown-fields": true
                                                },
                                                "lastEvaluation": {
                                                    "description": "lastEvaluation is the ResourceVersion last evaluated",
                                                    "type": "string"
                                                },
                                                "state": {
                                                    "description": "state describes the state of the lastEvaluation.\nIt is limited to three possible states for machine evaluation.",
                                                    "enum": [
                                                        "success",
                                                        "in_progress",
                                                        "failed"
                                                    ],
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "lastEvaluation",
                                                "state"
                                            ],
                                            "type": "object"
                                        },
                                        "description": "operatorStates is a map of operator ID to operator state evaluations.\nAny operator which consumes this kind SHOULD add its state evaluation information to this field.",
                                        "type": "object"
                                    }
                                },
                                "type": "object"
                            }
                        },
                        "required": [
                            "spec"
                        ],
                        "type": "object"
                    }
                },
                "subresources": {
                    "status": {}
                },
                "selectableFields": [
                    {
                        "jsonPath": ".spec.union.spec.name"
                    }
                ]
            }
        ],
        "names": {
            "kind": "TestKind",
            "plural": "testkinds"
        },
        "conversion": {
            "strategy": "webhook",
            "webhook": {
                "conversionReviewVersions": [
                    "v1"
                ],
                "clientConfig": {
                    "url": "http://foo.bar/convert"
                }
            }
        },
        "scope": "Namespaced"
    }
}