prompty 2.0.0-alpha.8

Prompty is an asset class and format for LLM prompts
Documentation

// Code generated by AgentSchema emitter; DO NOT EDIT.

use prompty::model::ArrayProperty;
use prompty::model::context::{LoadContext, SaveContext};


#[test]
fn test_array_property_load_json() {
    let json = r####"
{
  "items": {
    "kind": "string"
  }
}
"####;
    let result = ArrayProperty::from_json(json, &LoadContext::default());
    assert!(result.is_ok(), "Failed to load from JSON: {:?}", result.err());
    let instance = result.unwrap();
    let _ = instance; // load succeeded, no scalar properties to validate
}

#[test]
fn test_array_property_load_yaml() {
    let yaml = r####"
items:
  kind: string

"####;
    let result = ArrayProperty::from_yaml(yaml, &LoadContext::default());
    assert!(result.is_ok(), "Failed to load from YAML: {:?}", result.err());
    let instance = result.unwrap();
    let _ = instance; // load succeeded, no scalar properties to validate
}

#[test]
fn test_array_property_roundtrip() {
    let json = r####"
{
  "items": {
    "kind": "string"
  }
}
"####;
    let result = ArrayProperty::from_json(json, &LoadContext::default());
    assert!(result.is_ok(), "Failed to load: {:?}", result.err());
    let instance = result.unwrap();
    let json_output = instance.to_json(&SaveContext::default());
    assert!(json_output.is_ok(), "Failed to serialize to JSON: {:?}", json_output.err());
}