Skip to content

fix: normalize undefined to null and replace placeholders, fixes #14 #15#47

Merged
Dancode-188 merged 1 commit intomainfrom
fix/issue-14-15-variable-extraction
Dec 27, 2025
Merged

fix: normalize undefined to null and replace placeholders, fixes #14 #15#47
Dancode-188 merged 1 commit intomainfrom
fix/issue-14-15-variable-extraction

Conversation

@Dancode-188
Copy link
Copy Markdown
Owner

Fixes #14, #15

Problems

Two related bugs in variable extraction:

  1. undefined vs null: extractVariables could store undefined when JSONPath finds nothing, but the error case stores null. Inconsistent.

  2. Placeholder retention: When interpolating variables, {{placeholder}} syntax was kept in the output when variables were undefined/null. Makes it impossible to distinguish between actual placeholder syntax and missing variables.

Changes

  • Normalize JSONPath undefined results to null
  • Replace undefined variables with the string 'undefined'
  • Replace null variables with the string 'null'

Now variable values are consistent and placeholders actually get replaced.



Two related issues in variable extraction:

1. extractVariables could return undefined when JSONPath finds nothing,
   but should return null for consistency with error handling.

2. interpolateVariables kept {{placeholder}} syntax when variables were
   undefined/null instead of replacing them with string representations.

Changes:
- Normalize JSONPath undefined results to null
- Replace undefined variables with 'undefined' string
- Replace null variables with 'null' string

This makes variable handling consistent and prevents stale placeholders
in interpolated text.
@Dancode-188
Copy link
Copy Markdown
Owner Author

Fixes both consistency issues. Normalizing to null is cleaner than mixing undefined/null, and replacing placeholders with string representations makes debugging easier. CI passing.

@Dancode-188 Dancode-188 merged commit 10f742d into main Dec 27, 2025
2 checks passed
@Dancode-188 Dancode-188 deleted the fix/issue-14-15-variable-extraction branch December 28, 2025 06:14
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.

[Bug]: VariableExtractionService returns undefined instead of null when JSONPath result is missing

1 participant