{
  "properties": {
    "spec": {
      "anyOf": [
        {
          "required": [
            "http"
          ]
        },
        {
          "required": [
            "stream"
          ]
        }
      ],
      "properties": {
        "http": {
          "items": {
            "properties": {
              "authentication": {
                "properties": {
                  "enable": {
                    "type": "boolean"
                  },
                  "jwtAuth": {
                    "properties": {
                      "cookie": {
                        "type": "string"
                      },
                      "header": {
                        "type": "string"
                      },
                      "query": {
                        "type": "string"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "keyAuth": {
                    "properties": {
                      "header": {
                        "type": "string"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "type": {
                    "enum": [
                      "basicAuth",
                      "keyAuth",
                      "jwtAuth",
                      "wolfRBAC",
                      "hmacAuth"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "enable"
                ],
                "type": "object",
                "additionalProperties": false
              },
              "backends": {
                "items": {
                  "properties": {
                    "resolveGranularity": {
                      "enum": [
                        "endpoint",
                        "service"
                      ],
                      "type": "string"
                    },
                    "serviceName": {
                      "minLength": 1,
                      "type": "string"
                    },
                    "servicePort": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "x-kubernetes-int-or-string": true
                    },
                    "subset": {
                      "type": "string"
                    },
                    "weight": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "minItems": 1,
                "required": [
                  "serviceName",
                  "servicePort"
                ],
                "type": "array"
              },
              "match": {
                "properties": {
                  "exprs": {
                    "items": {
                      "oneOf": [
                        {
                          "required": [
                            "subject",
                            "op",
                            "value"
                          ]
                        },
                        {
                          "required": [
                            "subject",
                            "op",
                            "set"
                          ]
                        }
                      ],
                      "properties": {
                        "op": {
                          "enum": [
                            "Equal",
                            "NotEqual",
                            "GreaterThan",
                            "LessThan",
                            "In",
                            "NotIn",
                            "RegexMatch",
                            "RegexNotMatch",
                            "RegexMatchCaseInsensitive",
                            "RegexNotMatchCaseInsensitive"
                          ],
                          "type": "string"
                        },
                        "set": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "subject": {
                          "properties": {
                            "name": {
                              "minLength": 1,
                              "type": "string"
                            },
                            "scope": {
                              "enum": [
                                "Cookie",
                                "Header",
                                "Path",
                                "Query"
                              ],
                              "type": "string"
                            }
                          },
                          "required": [
                            "scope"
                          ],
                          "type": "object",
                          "additionalProperties": false
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    },
                    "minItems": 1,
                    "type": "array"
                  },
                  "hosts": {
                    "items": {
                      "pattern": "^\\*?[0-9a-zA-Z-._]+$",
                      "type": "string"
                    },
                    "minItems": 1,
                    "type": "array"
                  },
                  "methods": {
                    "items": {
                      "enum": [
                        "CONNECT",
                        "DELETE",
                        "GET",
                        "HEAD",
                        "OPTIONS",
                        "PATCH",
                        "POST",
                        "PUT",
                        "TRACE"
                      ],
                      "type": "string"
                    },
                    "minItems": 1,
                    "type": "array"
                  },
                  "paths": {
                    "items": {
                      "pattern": "^/[a-zA-Z0-9\\-._~%!$&'()+,;=:@/]*\\*?$",
                      "type": "string"
                    },
                    "minItems": 1,
                    "type": "array"
                  },
                  "remoteAddrs": {
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "required": [
                  "paths"
                ],
                "type": "object",
                "additionalProperties": false
              },
              "name": {
                "minLength": 1,
                "type": "string"
              },
              "plugin_config_name": {
                "minLength": 1,
                "type": "string"
              },
              "plugins": {
                "items": {
                  "properties": {
                    "config": {
                      "type": "object",
                      "x-kubernetes-preserve-unknown-fields": true
                    },
                    "enable": {
                      "type": "boolean"
                    },
                    "name": {
                      "minLength": 1,
                      "type": "string"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "required": [
                  "name",
                  "enable"
                ],
                "type": "array"
              },
              "priority": {
                "type": "integer"
              },
              "timeout": {
                "properties": {
                  "connect": {
                    "type": "string"
                  },
                  "read": {
                    "type": "string"
                  },
                  "send": {
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "websocket": {
                "type": "boolean"
              }
            },
            "required": [
              "name",
              "match",
              "backends"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "minItems": 1,
          "type": "array"
        },
        "stream": {
          "items": {
            "properties": {
              "backend": {
                "properties": {
                  "resolveGranularity": {
                    "enum": [
                      "endpoint",
                      "service"
                    ],
                    "type": "string"
                  },
                  "serviceName": {
                    "minLength": 1,
                    "type": "string"
                  },
                  "servicePort": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "x-kubernetes-int-or-string": true
                  },
                  "subset": {
                    "type": "string"
                  }
                },
                "required": [
                  "serviceName",
                  "servicePort"
                ],
                "type": "object",
                "additionalProperties": false
              },
              "match": {
                "properties": {
                  "ingressPort": {
                    "maximum": 65535,
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "required": [
                  "ingressPort"
                ],
                "type": "object",
                "additionalProperties": false
              },
              "name": {
                "minLength": 1,
                "type": "string"
              },
              "protocol": {
                "enum": [
                  "TCP",
                  "UDP"
                ],
                "type": "string"
              }
            },
            "required": [
              "name",
              "match",
              "backend",
              "protocol"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "minItems": 1,
          "type": "array"
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "properties": {
        "conditions": {
          "items": {
            "properties": {
              "message": {
                "type": "string"
              },
              "observedGeneration": {
                "type": "integer"
              },
              "reason": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
