{
  "schemaVersion": 1,
  "operation": {
    "operationId": "explainSemanticPreview",
    "method": "POST",
    "path": "/api/v1/workspaces/{workspace}/semantic-models/{model}/datasets/{dataset}/preview/explain",
    "summary": "Explain semantic model dataset row preview",
    "description": "",
    "tags": [
      "BI"
    ],
    "effect": "write",
    "confirmation": "conditional",
    "authorization": {
      "mode": "privilege",
      "privilege": "PREVIEW_DATA"
    },
    "parameters": [
      {
        "name": "workspace",
        "in": "path",
        "required": true,
        "description": "",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "model",
        "in": "path",
        "required": true,
        "description": "",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "dataset",
        "in": "path",
        "required": true,
        "description": "",
        "schema": {
          "type": "string"
        }
      }
    ],
    "requestBody": {
      "required": false,
      "description": "",
      "content": [
        {
          "contentType": "application/json",
          "schema": {
            "$ref": "#/components/schemas/SemanticPreviewRequest"
          }
        }
      ]
    },
    "responses": [
      {
        "status": "200",
        "description": "The request has succeeded.",
        "content": [
          {
            "contentType": "application/json",
            "schema": {
              "$ref": "#/components/schemas/SemanticExplainResponse"
            }
          }
        ]
      },
      {
        "status": "400",
        "description": "The server could not understand the request due to invalid syntax.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "401",
        "description": "Access is unauthorized.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "403",
        "description": "Access is forbidden.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "404",
        "description": "The server cannot find the requested resource.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "409",
        "description": "The request conflicts with the current state of the server.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "412",
        "description": "Precondition failed.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "413",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "415",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "422",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "429",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "500",
        "description": "Server error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "502",
        "description": "Server error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "503",
        "description": "Service unavailable.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      }
    ]
  },
  "schemas": {
    "ProblemDetails": {
      "example": {
        "code": "example",
        "detail": "example",
        "errors": [
          {
            "code": "example",
            "detail": "example",
            "field": "example"
          }
        ],
        "instance": "example",
        "requestId": "example",
        "status": 1,
        "title": "example",
        "type": "example"
      },
      "properties": {
        "code": {
          "example": "example",
          "type": "string"
        },
        "detail": {
          "example": "example",
          "type": "string"
        },
        "errors": {
          "example": [
            {
              "code": "example",
              "detail": "example",
              "field": "example"
            }
          ],
          "items": {
            "$ref": "#/components/schemas/ProblemFieldError"
          },
          "type": "array"
        },
        "instance": {
          "example": "example",
          "type": "string"
        },
        "requestId": {
          "example": "example",
          "type": "string"
        },
        "status": {
          "example": 1,
          "format": "int32",
          "type": "integer"
        },
        "title": {
          "example": "example",
          "type": "string"
        },
        "type": {
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "type",
        "title",
        "status",
        "detail",
        "instance",
        "code",
        "requestId",
        "errors"
      ],
      "type": "object"
    },
    "ProblemFieldError": {
      "example": {
        "code": "example",
        "detail": "example",
        "field": "example"
      },
      "properties": {
        "code": {
          "example": "example",
          "type": "string"
        },
        "detail": {
          "example": "example",
          "type": "string"
        },
        "field": {
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "field",
        "code",
        "detail"
      ],
      "type": "object"
    },
    "SemanticExplainResponse": {
      "example": {
        "args": [
          {
            "key": "example"
          }
        ],
        "columns": [
          "example"
        ],
        "facts": [
          "example"
        ],
        "mode": "example",
        "physicalDependencies": [
          "example"
        ],
        "relationshipPaths": [
          "example"
        ],
        "sql": "example",
        "stitchDimensions": [
          "example"
        ],
        "warnings": [
          "example"
        ]
      },
      "properties": {
        "args": {
          "example": [
            {
              "key": "example"
            }
          ],
          "items": {
            "additionalProperties": {},
            "type": "object"
          },
          "type": "array"
        },
        "columns": {
          "example": [
            "example"
          ],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "facts": {
          "example": [
            "example"
          ],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "mode": {
          "example": "example",
          "type": "string"
        },
        "physicalDependencies": {
          "example": [
            "example"
          ],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "relationshipPaths": {
          "example": [
            "example"
          ],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "sql": {
          "example": "example",
          "type": "string"
        },
        "stitchDimensions": {
          "example": [
            "example"
          ],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "warnings": {
          "example": [
            "example"
          ],
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "mode",
        "facts",
        "stitchDimensions",
        "physicalDependencies",
        "relationshipPaths",
        "sql",
        "args",
        "columns",
        "warnings"
      ],
      "type": "object"
    },
    "SemanticFieldRef": {
      "example": {
        "alias": "example",
        "field": "example"
      },
      "properties": {
        "alias": {
          "description": "Optional output column name.",
          "example": "example",
          "type": "string"
        },
        "field": {
          "description": "Semantic field or measure ID. Use the ID returned by catalog_list or catalog_get.",
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "field"
      ],
      "type": "object"
    },
    "SemanticFilter": {
      "example": {
        "fact": "example",
        "field": "example",
        "groups": [
          {
            "filters": []
          }
        ],
        "operator": "equals",
        "values": [
          "example"
        ]
      },
      "properties": {
        "fact": {
          "description": "Fact table used to resolve a conformed dimension when it is otherwise ambiguous.",
          "example": "example",
          "type": "string"
        },
        "field": {
          "description": "Semantic field ID. Omit only when groups supplies nested filters.",
          "example": "example",
          "type": "string"
        },
        "groups": {
          "description": "Nested filter groups.",
          "example": [
            {
              "filters": []
            }
          ],
          "items": {
            "$ref": "#/components/schemas/SemanticFilterGroup"
          },
          "type": "array"
        },
        "operator": {
          "$ref": "#/components/schemas/SemanticFilterOperator",
          "description": "Governed comparison operator. equals is used when omitted."
        },
        "values": {
          "description": "Comparison values. is_null and is_not_null accept no values.",
          "example": [
            "example"
          ],
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "SemanticFilterGroup": {
      "example": {
        "filters": []
      },
      "properties": {
        "filters": {
          "description": "Filters combined within this nested group.",
          "example": [
            {
              "fact": "example",
              "field": "example",
              "groups": [
                {
                  "filters": []
                }
              ],
              "operator": "equals",
              "values": [
                "example"
              ]
            }
          ],
          "items": {
            "$ref": "#/components/schemas/SemanticFilter"
          },
          "type": "array"
        }
      },
      "required": [
        "filters"
      ],
      "type": "object"
    },
    "SemanticFilterOperator": {
      "enum": [
        "equals",
        "in",
        "contains",
        "not_contains",
        "starts_with",
        "greater_than_or_equal",
        "less_than",
        "is_null",
        "is_not_null"
      ],
      "example": "equals",
      "type": "string"
    },
    "SemanticPreviewRequest": {
      "example": {
        "dimensions": [
          {
            "alias": "example",
            "field": "example"
          }
        ],
        "filters": [
          {
            "fact": "example",
            "field": "example",
            "groups": [
              {
                "filters": []
              }
            ],
            "operator": "equals",
            "values": [
              "example"
            ]
          }
        ],
        "limit": 1,
        "measures": [
          {
            "alias": "example",
            "field": "example"
          }
        ],
        "pageToken": "example",
        "sort": [
          {
            "direction": "asc",
            "field": "example"
          }
        ]
      },
      "properties": {
        "dimensions": {
          "example": [
            {
              "alias": "example",
              "field": "example"
            }
          ],
          "items": {
            "$ref": "#/components/schemas/SemanticFieldRef"
          },
          "type": "array"
        },
        "filters": {
          "example": [
            {
              "fact": "example",
              "field": "example",
              "groups": [
                {
                  "filters": []
                }
              ],
              "operator": "equals",
              "values": [
                "example"
              ]
            }
          ],
          "items": {
            "$ref": "#/components/schemas/SemanticFilter"
          },
          "type": "array"
        },
        "limit": {
          "example": 1,
          "format": "int32",
          "maximum": 1000,
          "minimum": 1,
          "type": "integer"
        },
        "measures": {
          "example": [
            {
              "alias": "example",
              "field": "example"
            }
          ],
          "items": {
            "$ref": "#/components/schemas/SemanticFieldRef"
          },
          "type": "array"
        },
        "pageToken": {
          "example": "example",
          "maxLength": 2048,
          "minLength": 1,
          "type": "string"
        },
        "sort": {
          "example": [
            {
              "direction": "asc",
              "field": "example"
            }
          ],
          "items": {
            "$ref": "#/components/schemas/SemanticSort"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "SemanticSort": {
      "example": {
        "direction": "asc",
        "field": "example"
      },
      "properties": {
        "direction": {
          "$ref": "#/components/schemas/SemanticSortDirection",
          "description": "Sort direction. Defaults to ascending when omitted."
        },
        "field": {
          "description": "Selected output field or alias to sort.",
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "field"
      ],
      "type": "object"
    },
    "SemanticSortDirection": {
      "enum": [
        "asc",
        "desc"
      ],
      "example": "asc",
      "type": "string"
    }
  }
}
