OpenAPIReader reads a local OpenAPI 3 YAML or JSON document and converts one named component schema into LangState’s Schema model. StateFactory then initializes canonical leaf fields from that schema.
The repository’s integration test uses a Registration schema. A documentation copy lives at examples/registration.openapi.yaml; the pinned source fixture is tests/data/schemas/registeration.yaml.
Read the root component
root_entity explicitly. Although the fixture contains x-sup.root_entity, the current reader selects the constructor value rather than discovering that extension automatically.
Create the states
guests.0.email appear when the application writes them.
What the reader preserves
EachSchemaField includes:
field_id,field_type, label, and description- whether the property appears in the OpenAPI
requiredlist - a default value or nested
SchemaFieldmapping - selected validation rules such as length, range, pattern, enum, and array limits
- property-level
x-supdata insidemetadata
Current parser boundaries
The pinned reader resolves direct$ref values and recursively parses object properties. Its handling of composed schemas is narrower: the Registration test documents that an array item expressed through allOf may not expose all nested item fields during initial parsing. Those indexed paths can still be created dynamically with set_field().
Treat OpenAPI operation endpoints, authentication, request execution, and server URLs as outside this reader’s scope. It extracts component state shape; it is not an API client or endpoint playground.