Skip to content

Added: Support partially overwrite keys in nested dict#1692

Merged
insspb merged 2 commits intocookiecutter:masterfrom
cksac:feature
Jun 6, 2022
Merged

Added: Support partially overwrite keys in nested dict#1692
insspb merged 2 commits intocookiecutter:masterfrom
cksac:feature

Conversation

@cksac
Copy link
Copy Markdown
Contributor

@cksac cksac commented Jun 6, 2022

cookiecutter.json

{
    "full_name": "Raphael Pierzina",
    "github_username": "hackebrot",
    "project": {
        "name": "Kivy Project",
        "description": "Kivy Project description",
    }
}

user_config.yaml

default_context:
  project:
    name: "My Project"

Current generated context:

{
    "full_name": "Raphael Pierzina",
    "github_username": "hackebrot",
    "project": {
        "name": "My Project",
    }
}

the whole project is replace by user config instead of replace project.name only.

Expected generated context:

{
    "full_name": "Raphael Pierzina",
    "github_username": "hackebrot",
    "project": {
        "name": "My Project",
        "description": "Kivy Project description",
    }
}

@insspb insspb added bug This issue/PR relates to a bug. enhancement This issue/PR relates to a feature request. labels Jun 6, 2022
@insspb insspb changed the title support partially overwrite keys in nested dict Added: Support partially overwrite keys in nested dict Jun 6, 2022
@insspb insspb merged commit 508ef46 into cookiecutter:master Jun 6, 2022
@insspb
Copy link
Copy Markdown
Member

insspb commented Jun 6, 2022

@cksac thank you for contribution. merged to master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement This issue/PR relates to a feature request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants