SchemaHelper

Helper object for working with JSON schemas.

Provides utility functions for parsing and validating JSON Schema definitions.

Functions

Link copied to clipboard
fun getProperty(schema: JsonSchema, propertyName: String): PropertyDefinition?

Gets the property definition for a given property name.

Link copied to clipboard
fun getPropertyDescription(schema: JsonSchema, propertyName: String): String?

Gets the description of a property in the schema.

Link copied to clipboard
fun getPropertyType(schema: JsonSchema, propertyName: String): List<String>?

Gets the types of a property in the schema.

Link copied to clipboard
fun hasAllRequiredProperties(schema: JsonSchema, vararg propertyNames: String): Boolean

Checks if all specified properties are required in the schema.

Link copied to clipboard
fun hasProperty(schema: JsonSchema, propertyName: String): Boolean

Checks if a schema has a property with the specified name.

Link copied to clipboard
fun isPropertyRequired(schema: JsonSchema, propertyName: String): Boolean

Checks if a property is required in the schema.

Link copied to clipboard
fun parseSchema(schemaJson: JsonElement?): JsonSchema?

Parses a JsonElement into a JsonSchema.