Documentation IndexFetch the complete documentation index at: /docs/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
def validate_data_using_schema( data: dict[str, Any] | list[dict[str, Any]], schema: dict[str, Any], )
from typing import TypedDict from playwright.async_api import Page from intuned_browser import validate_data_using_schema class Params(TypedDict): pass async def automation(page: Page, params: Params, **_kwargs): upload_data = { "file": { "file_name": "documents/report.pdf", "bucket": "my-bucket", "region": "us-east-1", "key": "documents/report.pdf", "endpoint": None, "suggested_file_name": "Monthly Report.pdf", "file_type": "document" }, "name": "Test File Upload" } upload_schema = { "type": "object", "required": ["file", "name"], "properties": { "file": {"type": "attachment"}, "name": {"type": "string"} } } validate_data_using_schema(upload_data, upload_schema) # Validation passes with Attachment type print("Validation passed") return "Validation passed"
from typing import TypedDict from playwright.async_api import Page from intuned_browser import validate_data_using_schema class Params(TypedDict): pass async def automation(page: Page, params: Params, **_kwargs): user_data = { "name": "John Doe", "email": "john@example.com", } user_schema = { "type": "object", "required": ["name", "email", "age"], "properties": { "name": {"type": "string", "minLength": 1}, "email": {"type": "string", "format": "email"}, "age": {"type": "number", "minimum": 0} } } validate_data_using_schema(user_data, user_schema) # this will throw # Validation fails, throws ValidationError print("Never reached") return "Never reached"
None