Skip to content
docsv0.17.0

SchemaFormParser

Parses a JSON-Schema-shaped input schema (`{type:object, properties:{...}, required:[...]}`) into a FormDefinition. Supports the base types string/integer/number/boolean; enum is read as a constraint. Properties whose type is outside that subset are dropped (a deferred type cannot be a field yet). Parser doctrine: SchemaForm never silently degrades a supported contract. An unsupported capability may be omitted. A supported capability declared with an invalid shape is a producer error and fails the parse.

SchemaFormParser::fromSchema()

public function fromSchema(string $id, array $inputSchema): Milpa\Live\Schema\FormDefinition

Parses a JSON-Schema-shaped input schema into a FormDefinition, failing fast on a malformed supported contract.

Parameters

Parameters of fromSchema()
NameTypeDescription
$idstring
$inputSchemaarray<string, mixed>