Skip to content

Fix for _replace_dynamic_values in canary file auto-generator #1103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nikhilkumarsingh
Copy link

@nikhilkumarsingh nikhilkumarsingh commented Mar 13, 2025

Issue #, if available:

N/A

Description of changes:

While generating canary test files from contract input files, we are getting following error if input structure has a list of dicts:

json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

Example input:

{
        "CreateInputs": {
            "Property": [{"Nested": "{{test123}}"}]
        }
}

The issue is happening because current logic treats list elements as strings.

This commit fixes this issue by updating the parsing logic to be recursive when list items are dicts.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

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.

2 participants