{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "StageTrace CLI inspect response 1.0",
  "type": "object",
  "required": [
    "schemaVersion",
    "command",
    "status",
    "data",
    "errors",
    "warnings",
    "timingMs"
  ],
  "properties": {
    "schemaVersion": {
      "const": "1.0"
    },
    "command": {
      "const": "inspect"
    },
    "status": {
      "type": "string",
      "enum": [
        "ok",
        "error"
      ]
    },
    "data": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "stageId",
            "rootLayer",
            "sessionLayer",
            "defaultPrim",
            "upAxis",
            "metersPerUnit",
            "layerCount",
            "primCount",
            "typeCounts",
            "topLevelPrims",
            "composition"
          ],
          "properties": {
            "stageId": {
              "type": "string"
            },
            "rootLayer": {
              "type": "object",
              "required": [
                "identifier"
              ],
              "properties": {
                "identifier": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "sessionLayer": {
              "type": "object",
              "required": [
                "present",
                "identifier"
              ],
              "properties": {
                "present": {
                  "type": "boolean"
                },
                "identifier": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "defaultPrim": {
              "type": "object",
              "required": [
                "present",
                "path"
              ],
              "properties": {
                "present": {
                  "type": "boolean"
                },
                "path": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "upAxis": {
              "type": "object",
              "required": [
                "value",
                "authored"
              ],
              "properties": {
                "value": {
                  "type": "string"
                },
                "authored": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            "metersPerUnit": {
              "type": "object",
              "required": [
                "value",
                "authored"
              ],
              "properties": {
                "value": {
                  "type": "number"
                },
                "authored": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            },
            "layerCount": {
              "type": "number"
            },
            "primCount": {
              "type": "number"
            },
            "typeCounts": {
              "type": "object",
              "patternProperties": {
                "^.+$": {
                  "type": "number"
                }
              },
              "additionalProperties": false
            },
            "topLevelPrims": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "composition": {
              "type": "object",
              "required": [
                "referencePrimCount",
                "payloadPrimCount",
                "variantSetCount"
              ],
              "properties": {
                "referencePrimCount": {
                  "type": "number"
                },
                "payloadPrimCount": {
                  "type": "number"
                },
                "variantSetCount": {
                  "type": "number"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {},
          "additionalProperties": false
        }
      ]
    },
    "errors": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["code", "message"],
        "properties": {
          "code": {"type": "string"},
          "message": {"type": "string"}
        },
        "additionalProperties": false
      }
    },
    "timingMs": {
      "type": "number"
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "status": {
            "const": "ok"
          }
        },
        "required": [
          "status"
        ]
      },
      "then": {
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "stageId",
              "rootLayer",
              "sessionLayer",
              "defaultPrim",
              "upAxis",
              "metersPerUnit",
              "layerCount",
              "primCount",
              "typeCounts",
              "topLevelPrims",
              "composition"
            ],
            "properties": {
              "stageId": {
                "type": "string"
              },
              "rootLayer": {
                "type": "object",
                "required": [
                  "identifier"
                ],
                "properties": {
                  "identifier": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              },
              "sessionLayer": {
                "type": "object",
                "required": [
                  "present",
                  "identifier"
                ],
                "properties": {
                  "present": {
                    "type": "boolean"
                  },
                  "identifier": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              },
              "defaultPrim": {
                "type": "object",
                "required": [
                  "present",
                  "path"
                ],
                "properties": {
                  "present": {
                    "type": "boolean"
                  },
                  "path": {
                    "type": "string"
                  }
                },
                "additionalProperties": false
              },
              "upAxis": {
                "type": "object",
                "required": [
                  "value",
                  "authored"
                ],
                "properties": {
                  "value": {
                    "type": "string"
                  },
                  "authored": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "metersPerUnit": {
                "type": "object",
                "required": [
                  "value",
                  "authored"
                ],
                "properties": {
                  "value": {
                    "type": "number"
                  },
                  "authored": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "layerCount": {
                "type": "number"
              },
              "primCount": {
                "type": "number"
              },
              "typeCounts": {
                "type": "object",
                "patternProperties": {
                  "^.+$": {
                    "type": "number"
                  }
                },
                "additionalProperties": false
              },
              "topLevelPrims": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "composition": {
                "type": "object",
                "required": [
                  "referencePrimCount",
                  "payloadPrimCount",
                  "variantSetCount"
                ],
                "properties": {
                  "referencePrimCount": {
                    "type": "number"
                  },
                  "payloadPrimCount": {
                    "type": "number"
                  },
                  "variantSetCount": {
                    "type": "number"
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "errors": {
            "type": "array",
            "maxItems": 0
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "status": {
            "const": "error"
          }
        },
        "required": [
          "status"
        ]
      },
      "then": {
        "properties": {
          "data": {
            "type": "object",
            "properties": {},
            "additionalProperties": false
          },
          "errors": {
            "type": "array",
            "minItems": 1
          }
        }
      }
    }
  ],
  "additionalProperties": false
}
