Skip to content

[record_use] Implementation: JSON: Separate recordings of instances and calls #2886

@dcharkes

Description

@dcharkes

The recordings contain both recordings of instances and of static calls - but the fields that are required are not the same, leading to an underspecified schema.

For const instances only the instances property should and must be supplied. And for static calls only the calls property should and must be supplied.

It would be cleaner to separate them.

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$ref": "#/definitions/RecordedUses",
  "definitions": {
    // ...
"RecordedUses": {
      "type": "object",
      "properties": {
        // ...
        "recordings": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Recording"
          }
        }
      },
      // ...
    },
    "Recording": {
      "type": "object",
      "properties": {
        "calls": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Call"
          }
        },
        "definition": {
          "type": "object",
          "properties": {
            "identifier": {
              "$ref": "#/definitions/Identifier"
            },
            "loading_unit": {
              "type": "string"
            }
          },
          "required": [
            "identifier"
          ]
        },
        "instances": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Instance"
          }
        }
      },
      "required": [
        "definition",
        // cannot list calls or instances
      ]
    }
  }
}

(Split from #1093)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions