Skip to content

rescript-schema 9.3.0: Cannot read properties of undefined (reading 'length') #156

@cknitt

Description

@cknitt

Using [email protected]:

@schema
type rule = {patterns: array<array<string>>}

@schema
type rules = array<rule>

@schema
type config = {rules: rules}

let _ = "{}"->S.parseJsonStringOrThrow(configSchema)

gives the following exception:

TypeError [Error]: Cannot read properties of undefined (reading 'length')

(instead of stating that the rules field is missing)

In [email protected], I get

SuryError: Failed parsing: Expected { rules: { patterns: string[][]; }[]; }, received { }

which is better, but I cannot use that version because of #124.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions