Skip to content

Request body schema for PATCH /Api/UpdateShield/Channel/{channelName} is incorrect. #37

@ferrywlto

Description

@ferrywlto

Problem

From bulkEngine.ts we can find the actual definition of ShieldUpdateChannelConfig as below:

export interface ShieldUpdateChannelStorage {
    'latest': string;
    'previous': string;
}
export type ShieldUpdateChannelConfig = ShieldUpdateChannelStorage & {
    'name': DeployChannel;
};

However in Data-Gateway.json, the schema of PATCH /Api/UpdateShield/Channel/{channelName} request body is different:

"schema": {
  "type": "object",
  "properties": {
    "latest": {
      "description": "Flag that indicates if the ring should be operating off of the latest version number provided by the channel (`true`) or the previous (`false`).",
      "examples": ["true"],
      "type": "boolean"
    },
    "number": {
      "description": "Ring number that this configuration belongs to.",
      "examples": [1],
      "type": "integer",
      "minimum": 0
    }
  },
  "examples": [{
    "latest": true,
    "number": 1
  }]
}

This is believed due to some typos when copying from ring configuration.

This is supported by the example itself.

"examples": {
  "Channel Configuration Details": {
    "description": "Example channel configuration object.",
    "summary": "Channel Configuration",
    "value": {
      "latest": "1.12.5",
      "previous": "1.12.4"
    }
  }
},

Task

We should change the request body schema of the path in question back to :

"schema": {
  "type": "object",
  "properties": {
    "latest": {
      "description": "Version number of the latest update available to the channel.",
      "examples": ["1.12.5"],
      "type": "string"
    },
    "previous": {
      "description": "Version number of the number that is being replaced via ring deployment, available to all rings at the minimum.",
      "examples": ["1.12.14"],
      "type": "string"
    }
  },
  "examples": [{
    "latest": "1.12.5",
    "previous": "1.12.4"
  }]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions