RestBI Documentation
  • Welcome to RestBI
  • Getting Started
    • Quickstart Guide for RestBI
    • Installation
      • Docker Compose
      • Kubernetes
  • Object Definitions
    • Data Model
      • Model
      • Connection
      • Table
      • Join
      • Column
      • Formula
      • ValidationResult
    • Query
      • Query
      • QueryFilter
      • SQLResult
  • SDK
    • Overview
    • Reference
      • RestBIClient
      • executeQuery
      • getMetadata
      • validateModel
  • API
    • Overview
    • Reference
      • POST /query
      • POST /validate
      • POST /metadata
      • GET /
  • Examples
    • RestBI Demo App
      • Installation
      • Report Builder
      • Drill Anywhere
      • Model Helper
Powered by GitBook
On this page
  1. API
  2. Reference

POST /validate

PreviousPOST /queryNextPOST /metadata

Last updated 9 months ago

Description: Validates a against the database schema.

Request Body:

  • Type: Model

  • Description: A JSON object representing the model to validate.

Example Request:

{
  "id": "1",
  "name": "ChinookModel",
  "connection": {
    "id": "2",
    "name": "Chinook",
    "host": "localhost",
    "port": 5432,
    "user": "postgres",
    "password": "test",
    "database": "chinook",
    "type": "POSTGRES"
  },
  "tables": [
    {
      "id": "1",
      "dbName": "album",
      "name": "Album",
      "columns": [
        {
          "id": "title",
          "dbName": "title",
          "name": "Album Title",
          "dataType": "STRING"
        }
      ]
    }
  ],
  "joins": [],
  "formulas": [],
  "filters": []
}

Response:

  • 200 OK:

    • Type: ValidationResult

    • Body: A JSON object containing the validation results.

  • 500 Internal Server Error:

    • Type: SQLError

    • Body:

      { "message": "An error occurred while validating the model." }

CURL Example:

curl -X POST http://localhost:3000/validate \
  -H "Content-Type: application/json" \
  -d '{
        "id": "1",
        "name": "ChinookModel",
        "connection": {
            "id": "2",
            "name": "Chinook",
            "host": "localhost",
            "port": 5432,
            "user": "postgres",
            "password": "test",
            "database": "chinook",
            "type": "POSTGRES"
        },
        "tables": [
            {
                "id": "1",
                "dbName": "album",
                "name": "Album",
                "columns": [
                    {
                        "id": "title",
                        "dbName": "title",
                        "name": "Album Title",
                        "dataType": "STRING"
                    }
                ]
            }
        ],
        "joins": [],
        "formulas": [],
        "filters": []
    }'
Model