ajv-validator / ajv-validator/ajv

Clarification - Purpose of "mergeEvaluated" in CodeGen?

Abierto
#1,841 5 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
14.8k
Forks
1k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hello! In implementing some custom keywords, I'm not sure of when/why to use the [mergeEvaluated](https://github.com/ajv-validator/ajv/blob/8d20f6b33c93e326279ab8ac98609d52eb40be91/lib/compile/validate/index.ts#L495) 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!

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.