Page MenuHomePhabricator

[Event Platform] - Add schema CI test that array ensures properties with object types also enumerate object properties
Closed, ResolvedPublic3 Estimated Story Points

Description

Context

This schema should have failed validation in CI, because it defined this property:

tunnels:
  type: array
  items:
    type: object

Per the documentation, you need to also enumerate the properties of the items in the array:

tunnels:
  type: array
  items:
    type: object
    properties:
      anonymous:
        type: boolean
      operator:
        type: string
      type:
        type: string

Proposal

Tests in event/schema/secondary should reject schemas which define type: array and type: object in the items section.

Consequences

  • It's not possible to merge patches that contain faulty definitions for arrays of objects

Event Timeline

Ottomata renamed this task from Test that array properties with object types also enumerate object properties to [Event Platforom] - Add schema CI test that array ensures properties with object types also enumerate object properties.Jun 18 2024, 1:15 PM
Ottomata renamed this task from [Event Platforom] - Add schema CI test that array ensures properties with object types also enumerate object properties to [Event Platform] - Add schema CI test that array ensures properties with object types also enumerate object properties.Jun 25 2024, 8:32 PM
Ottomata edited projects, added Event-Platform, Data-Engineering; removed EventStreams.
Ottomata added subscribers: tchin, gmodena, Ahoelzl.

Change #1068863 had a related patch set uploaded (by TChin; author: TChin):

[schemas/event/secondary@master] Version bump jsonschema-tools to 1.3.0

https://gerrit.wikimedia.org/r/1068863

Change #1068863 merged by jenkins-bot:

[schemas/event/secondary@master] Version bump jsonschema-tools to 1.3.0

https://gerrit.wikimedia.org/r/1068863