Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

New v3 path error message should distinguish between "lack of key" and "key equals null" #494

Copy link
Copy link
@zerkms

Description

@zerkms
Issue body actions

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Type\shape(['foo' => Type\string()], true)->assert([]);
Type\shape(['foo' => Type\string()], true)->assert(['foo' => null]);

Both these two evaluations result in a AssertException with a Expected "array{'foo': string}", got "null" at path "foo". message.

It's misleading as the lack of the key is definitely different beast to the key that is = null.

Describe the solution you'd like
I would prefer two distinct messages (non-native speaker here, so needs polishing):

Expected "array{'foo': string}", path "foo" does not exist.
Expected "array{'foo': string}", got "null" at path "foo".

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

Labels

Type: EnhancementMost issues will probably ask for additions or changes.Most issues will probably ask for additions or changes.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.