Skip to content

Any way to get meta by SchemaPointer? #73

Closed
@gigi

Description

@gigi

Hi!

Is it possible to get metadata of field by InvalidValue exception?
For example I want to know if failed field marked as required in the schema.

 try {
    $schema = Schema::import($schemaFile);         
    $schema->in((object)$data);
} catch (Exception $exception) {
    // something like this JsonPointer::get((object)$schema, $exception->getSchemaPointer())->required;        
    // or
    // $meta = $schema->getByPointer(Schema$exception->getSchemaPointer())->required;
}

Thanx!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions