Skip to content

Fix the dns_analytics rows item schema: each row is an array of values, not a scalar #1062

Description

@ggalmazor

While validating a client's test double against content/v2/openapi.yml, we found that the GET /{account}/dns_analytics 200 response types data.rows items as scalars, while both the schema's own example and the production API send each row as an array of values (one entry per headers column).

The spec currently reads (around line 2898):

rows:
  type: array
  items:
    anyOf:
      - type: integer
      - type: string
      - $ref: '#/components/schemas/Date'
    example: ["example.com", "2024-08-01", 102985]

The example contradicts the items schema: it is one row as a 3-element array, which is what production returns. A response like the following fails validation against the current schema with "got array, want integer" on every row:

{"data": {"headers": ["zone_name", "date", "volume"], "rows": [["example.com", "2024-08-01", 102985]]}}

The items schema should therefore be an array of scalars:

rows:
  type: array
  items:
    type: array
    items:
      anyOf:
        - type: integer
        - type: string
        - $ref: '#/components/schemas/Date'
  example: [["example.com", "2024-08-01", 102985]]

Due to this, any client generated or validated from the spec rejects real dns_analytics responses; we currently carry an explicit exemption for this endpoint in our contract checks and would be happy to drop it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageIssues that are opened and need to be investigated

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions