DOVU Operating System
  • Welcome to DOVU OS
  • DOVU Operating System
    • The Problem
    • What is DOVU OS?
    • Core Concepts
    • Charger Protocol
    • Beyond Sustainability
  • Workflow Engine
    • The Engine
    • What to Expect Next
    • API Reference
      • Workflow Blueprints
      • Workflow Block Instance Processing
      • Actor Registration and Roles
      • Credit Warehouse Queries
      • Audit Trails
      • Schema and Data Validation
    • Tutorials and Examples
  • Template Language
    • Rationale
    • At a glance
    • Use Case: ELV Recycling
    • Language Primitives
  • DOVU Guardian Tools
    • Guardian Deployment System
    • Guardian PHP SDK
Powered by GitBook
On this page
  1. Workflow Engine
  2. API Reference

Schema and Data Validation

Empowers developers to explore schemas, validate data, and test system integrations for specific workflows before committing to their execution.

PreviousAudit TrailsNextTutorials and Examples

Last updated 5 months ago

The Schema and Data Validation module enables developers to fully understand and test the structural requirements of workflows. By exposing schema details and providing tools to validate data, it ensures that workflows are configured correctly and ready for production. This functionality is critical for ensuring alignment between data inputs and workflow expectations.

Key Benefits

  1. Schema Exploration: Developers can retrieve schema definitions and their associated fields, understanding the structure and constraints of the data required for workflows.

  2. Data Validation: The ability to test data submissions against schemas ensures that workflows are not disrupted by invalid or improperly formatted data.

  3. Pre-Workflow Testing: Developers can simulate data submissions to validate the workflow’s functionality before committing to real-world use. This eliminates errors during the workflow lifecycle.

  4. Enhanced Querying: When combined with Credit Warehouse Queries, users can align schema details with the fields required to interact with issued assets, creating a seamless querying experience.


How It Works

  1. Schema Index: Retrieve a list of schemas tied to specific workflows. Each schema outlines the structure, fields, and validation requirements for data submissions.

  2. Schema Fields: Explore detailed field-level metadata within schemas, such as required fields, primary keys, and data types.

  3. Test Data Validation: Use the validation endpoint to test data submissions before applying them to a live workflow. This ensures that data meets all schema requirements and prevents issues downstream.


Use Cases

  1. Pre-Deployment Testing: Developers can test workflows and validate data against schemas to ensure smooth operation in production environments.

  2. External Query Alignment: Schema exploration helps external users understand which fields are required to query the system, especially when interacting with the Credit Warehouse.

  3. Streamlined Workflow Development: By understanding schemas and validating data, developers can design workflows that are optimized for their specific use cases.



Future Enhancements

In future iterations, we plan to introduce a Schema Builder that will revolutionize how developers and users interact with the DOVU OS system. This highly visual, drag-and-drop interface will enable seamless creation, modification, and updating of schemas in real-time. The key features of the Schema Builder will include:

  1. User-Friendly Design: A simple, intuitive interface that empowers developers and non-technical users to construct schemas with ease, eliminating the need for extensive technical knowledge.

  2. Dynamic Updates: The ability to modify schemas dynamically and pivot designs as project needs evolve, ensuring maximum flexibility and adaptability.

  3. Workflow Integration: Once built or updated, schemas will automatically connect to the larger workflow system, enabling seamless integration into the project lifecycle. This ensures that schema changes are instantly reflected in workflows, maintaining alignment across the system.

  4. Visual Flow Representation: A drag-and-drop flow representation that simplifies schema creation and aligns it with workflow visualization, making it easier to design end-to-end solutions.

This future enhancement will significantly streamline the process of schema creation and management, making the system more accessible, flexible, and efficient for all users. It represents a key step forward in empowering users to fully harness the potential of the DOVU OS Workflow Engine.

Schema Index

get
Query parameters
pagestringOptionalExample: 2
Header parameters
AcceptstringRequiredExample: application/json
Content-TypestringRequiredExample: application/json
Responses
200Success
application/json
get
GET /api/v1/schema HTTP/1.1
Host: 
Accept: text
Content-Type: text
200Success
{
  "current_page": 1,
  "data": [
    {
      "id": "9d9d33ab-7a9b-4ff5-9a4d-4ad860f23b25",
      "name": "Person",
      "description": "Person",
      "key": "project-schema-person",
      "parent_id": null
    },
    {
      "id": "9d9d33ab-7afe-40b5-900b-6ff49cab50f5",
      "name": "Address",
      "description": "Address",
      "key": "project-schema-address",
      "parent_id": "9d9d33ab-7a9b-4ff5-9a4d-4ad860f23b25"
    },
    {
      "id": "9d9d33ab-7b5d-4b78-b792-e5ba1a059072",
      "name": "latlong",
      "description": "latlong",
      "key": "project-schema-latlong",
      "parent_id": "9d9d33ab-7afe-40b5-900b-6ff49cab50f5"
    },
    {
      "id": "9dab275f-aac3-424c-8dcf-8a97eaeb8c96",
      "name": "Project Schema Test 4",
      "description": "Schema for Project Test 4",
      "key": "project-schema-test-4",
      "parent_id": null
    }
  ],
  "first_page_url": "http://127.0.0.1:8000/api/v1/schema?page=1",
  "from": 1,
  "last_page": 1,
  "last_page_url": "http://127.0.0.1:8000/api/v1/schema?page=1",
  "links": [
    {
      "url": null,
      "label": "« Previous",
      "active": false
    },
    {
      "url": "http://127.0.0.1:8000/api/v1/schema?page=1",
      "label": "1",
      "active": true
    },
    {
      "url": null,
      "label": "Next »",
      "active": false
    }
  ],
  "next_page_url": null,
  "path": "http://127.0.0.1:8000/api/v1/schema",
  "per_page": 15,
  "prev_page_url": null,
  "to": 4,
  "total": 4
}

Schema Fields

get
Responses
200Success
application/json
get
GET /api/v1/schema/schema/fields HTTP/1.1
Host: 
Accept: */*
200Success
[
  {
    "id": "9d9d33ab-7caa-4961-a11e-13468eb416af",
    "schema_id": "9d9d33ab-7a9b-4ff5-9a4d-4ad860f23b25",
    "field_type_id": "ac8d302a-ee48-4467-bbaf-bfd736d03f7e",
    "name": "name",
    "whitelisted_values": null,
    "required": 1,
    "is_primary_field": 0,
    "description": "name of person",
    "key": "schema-person-name",
    "created_at": "2024-11-30T16:43:43.000000Z",
    "updated_at": "2024-11-30T16:43:43.000000Z"
  },
  {
    "id": "9d9d33ab-7d1c-436a-8fe3-7400934f1b5e",
    "schema_id": "9d9d33ab-7a9b-4ff5-9a4d-4ad860f23b25",
    "field_type_id": "82803533-7aab-43a7-8fbb-7a42d2307d32",
    "name": "age",
    "whitelisted_values": null,
    "required": 0,
    "is_primary_field": 0,
    "description": "age of person",
    "key": "schema-person-age",
    "created_at": "2024-11-30T16:43:43.000000Z",
    "updated_at": "2024-11-30T16:43:43.000000Z"
  }
]
  • GETSchema Index
  • GETSchema Fields
  • POSTTest Data Schema Validation

Test Data Schema Validation

post
Header parameters
Content-TypestringRequiredExample: application/json
AcceptstringRequiredExample: application/json
RefererstringRequiredExample: localhost:8000
Body
namestringRequired
ageintegerRequired
Responses
200Success
application/json
422Error
application/json
post
POST /api/v1/schema/schema/validate HTTP/1.1
Host: 
Content-Type: application/json
Accept: text
Referer: text
Content-Length: 148

{
  "name": "John Doe",
  "age": 30,
  "address": {
    "street": "123 Main St",
    "city": "Anytown",
    "postcode": "12345",
    "latlong": {
      "lat": "52.768211",
      "long": "-0.377180"
    }
  }
}
{
  "message": "Data is valid"
}