Consul API Gateway "rules.matches.method"

Playing around with the Consul API Gateway & I have encountered a small issue I am unable to figure out.

The configuration at the bottom below works fine, but when I try to add more than one method for the rule (method: HEAD), I get an error.

I’ve tried adding as list, in multiple different “formats” without success.
The documentation states:

Specifies a list of strings that define matches based on HTTP request method.
You may specify the following values: ...

How can I add e.g. HEAD & GET to the same rule?

Error message

The HTTPRoute "whoami" is invalid: 
* spec.rules[1].matches[0].method: Invalid value: "array": spec.rules[1].matches[0].method in body must be of type string: "array"
* spec.rules[1].matches[0].method: Unsupported value: []interface {}{"HEAD", "GET"}: supported values: "GET", "HEAD", "POST", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATCH"

routes.yaml

apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  name: whoami
  namespace: default
spec:
  hostnames: []
  parentRefs:
  - name: api-gateway
  rules:
  - matches:
    - method: HEAD
      path:
        type: PathPrefix
        value: /whoareyou
      headers:
      - name: Host
        type: RegularExpression
        value: "^localhost:.+$"
    backendRefs:
    - kind: Service
      name: whoami
      namespace: demos
      port: 80
      weight: 100
    filters:
    - type: URLRewrite
      urlRewrite:
        path:
          type: ReplacePrefixMatch
          replacePrefixMatch: /whoami

consul version: 1.15.2
helm-chart: v1.1.1 (kustomized)
Kubernetes: v1.25.9
Gateway CRDs: v0.5.4

I’ve never used this feature myself, but just looking at the documentation you linked to, I can see that it’s inconsistent within itself:

Near the bottom it says:

Specifies a list of strings that define matches based on HTTP request method.

Yet near the top of the page it says:

Clearly these can’t both be right.

I suggest reporting this to the relevant issue tracker. My guess based on the error messages you posted, is it’s currently impossible to list multiple methods in one rule.

GitHub Issue, for reference.

The configuration requires separate entries for different methods (more details in github issue answer), so the documentation is a bit misleading:

# ..snip
    matches:
    - method: HEAD
      path:
        type: PathPrefix
        value: /whoareyou
      headers:
      - name: Host
        type: RegularExpression
        value: "^localhost:.+$"
    - method: GET
      path:
        type: PathPrefix
        value: /whoareyou
      headers:
      - name: Host
        type: RegularExpression
        value: "^localhost:.+$"
# ..snip