question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clarification - Purpose of "mergeEvaluated" in CodeGen?

See original GitHub issue

Hello! In implementing some custom keywords, I’m not sure of when/why to use the mergeEvaluated method of KeywordCxt class, and was wondering if I could get some clarification? So far, I haven’t been able to find anything on it within the docs or the src.

Presumably it merges a subschema’s SchemaCxt into the current keyword’s KeywordCxt, and I see it’s employed by many existing keywords already, but I’m not sure what effect that actually has. When I’ve overwritten standard keywords to omit their calls to mergeEvaluated or mergeValidEvaluated, it never seems to change the behavior of my validation or its output. Any explanation would be appreciated. Thanks!

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
epoberezkincommented, Dec 10, 2021

It statically (that is, during compilation time), when it can, or dynamically (during validation time), when it can’t do it statically, collects object properties and array items that were evaluated - this information is then used by the keywords unevaluatedProperties and unevaluatedItems to determine which properties/items they should be applied to.

If you do not use unevaluatedProperties / unevaluatedItems keywords that would have indeed no effect, but it’s impossible to determine during the compilation whether these keywords are used, as they can be in another schema, so as long as these keywords might be used this information has to be collected.

0reactions
epoberezkincommented, Dec 14, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Motion for Clarification - Connecticut Judicial Branch
Thus, the purpose of a clarification is to take a prior statement, decision or order and make it easier to understand. Motions for...
Read more >
Clarifying the Issue - New York State Department of Health
Your purpose in clarifying the issue is to identify and gain a clear understanding of in which component of the focus area is...
Read more >
Clarification of purpose of medication form
Under the Disability Services Act 2006, some medications could be considered Chemical Restraint. Please consider the following extracts from the relevant Acts ...
Read more >
Clarify Definition & Meaning - Merriam-Webster
The meaning of CLARIFY is to make understandable. How to use clarify in a sentence.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found