Skip to content

JsonSchemaValidator

Namespace: Vercel.AI.ProviderUtils

public static class JsonSchemaValidator

Applies a JSON Schema document. Unknown object properties are dropped.

Inheritance: object

View source

TryApply(JsonElement, JsonNode, out JsonElement, out string?)

Section titled “TryApply(JsonElement, JsonNode, out JsonElement, out string?)”
public static bool TryApply(JsonElement value, JsonNode schema, out JsonElement projected, out string? error)

Projects <code class=“paramref”>value</code> through <code class=“paramref”>schema</code>.

Parameters

Name Type Description
value JsonElement
schema JsonNode
projected JsonElement
error string

Returns: bool

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product