Skip to content

Avoid fallback when definition keys contain expressions#16

Closed
sibmaks wants to merge 4 commits intomainfrom
codex/add-flag-for-expression-handling-in-options
Closed

Avoid fallback when definition keys contain expressions#16
sibmaks wants to merge 4 commits intomainfrom
codex/add-flag-for-expression-handling-in-options

Conversation

@sibmaks
Copy link
Owner

@sibmaks sibmaks commented Jan 12, 2026

Motivation

  • Allow definition-key fallback for plain string keys while preserving strict parsing for keys that look like expressions.
  • Prevent silent masking of real expression parse errors when a key already contains expression delimiters.

Description

  • Added a definitionKeyExpressionFallback option to TemplateCompileOptions to enable opt-in fallback behavior for definition keys.
  • Wired TemplateCompilerImpl to pass the new option into RootTemplateExpressionFactory and added compileDefinitionObject to use the fallback-aware compile path.
  • Updated RootTemplateExpressionFactory to accept the fallback flag, changed parseObjectKey to accept an allowFallback boolean, and added containsExpression helper to skip fallback when a key contains "{{".
  • When fallback is allowed and a key is a plain string, the code now logs a warning and uses a ConstantTemplateExpression for the raw key; expression-like keys will still surface parse errors.

Testing

  • No automated tests were executed as part of this change.
  • Existing test suite was not run by this rollout.

Codex Task

@sibmaks sibmaks closed this Feb 6, 2026
@sibmaks sibmaks deleted the codex/add-flag-for-expression-handling-in-options branch February 6, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant