Closed Bug 1527183 Opened 6 years ago Closed 6 years ago

Bindings schema is weird..

Categories

(Taskcluster :: Services, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dustin, Assigned: dustin)

Details

$schema: "/schemas/common/metaschema.json#"                                                                                                                                                                                                    
title:   "List of Bindings"
type: "array"
properties:
  items:
    title:              "Binding"
    description: |
      Exchange and RoutingKeyPattern for each binding
    type:               object
    properties:
      exchange:
        type:           string
      routingKeyPattern:
        type:           string
    additionalProperties:     false
    required:
      - exchange
      - routingKeyPattern
additionalProperties: false
required: [items]

that has type: array, but specifies an object with property items.

In the docs, this appears as a property named "items". In the API, it seems to accept things of the shape

{
  bindings: [
    {exchange: .., routingKeyPattern: ..},
  ],
  ...
}

as expected. So I think fixing this is just a matter of fixing the schema file. I'll also add some validation to make sure this situation can't recur.

https://github.com/taskcluster/taskcluster/pull/213

This is hard to validate with json-schema (the dependencies feature does not make it easy to enforce a particular value for the type property).

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.