Skip to content

Conversation

@bfollington
Copy link
Contributor

Allow the user to supply extraneous properties, we will just ignore them.

Postel's Law: be conservative in what you do, be liberal in what
you accept from others.

Properties were previously being validated and would complain if you
included a property that was not allowed. Instead, we want to validate
properties, while allowing additional properties, but ignoring those
additional properties when rendering. This will make us more robust to
LLM hallucinations.
- We make the validator more lenient
- Also the validator decorates the object in various ways that we don't
  want to expose, so better to give it its own copy
@bfollington bfollington changed the title Make common-ui properties lenient Make common-ui component properties lenient Jun 17, 2024
@bfollington bfollington merged commit 9e60c88 into main Jun 17, 2024
seefeldb pushed a commit that referenced this pull request Jun 17, 2024
* Make vnode properties liberal in what they accept

Postel's Law: be conservative in what you do, be liberal in what
you accept from others.

Properties were previously being validated and would complain if you
included a property that was not allowed. Instead, we want to validate
properties, while allowing additional properties, but ignoring those
additional properties when rendering. This will make us more robust to
LLM hallucinations.

* Give JSON validator a different object

- We make the validator more lenient
- Also the validator decorates the object in various ways that we don't
  want to expose, so better to give it its own copy

---------

Co-authored-by: Gordon Brander <gordonbrander@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants