Skip to content

Unexpected scheme default value behaviour #1037

@bozaro

Description

@bozaro

Bug Report

Looks like it is not possible to set the attribute value if the schema has declared the default attribute value.

1. Minimal reproduce step (Required)

schema Foo:
    a: {str:str} = {"name": "test"}
    b: [int] = [1, 2, 3]

foo = Foo {
    a: {"one": "two"}
    b: [42]
}

2. What did you expect to see? (Required)

I expect to see values:

foo:
  a:
    one: two
  b:
  - 42

3. What did you see instead (Required)

For this scheme, the explicit value of each field in the foo structure is set, but nevertheless the values flow from the description of the structure.

foo:
  a:
    name: test
    one: two
  b:
  - 42
  - 2
  - 3

4. What is your KCL components version? (Required)

kcl version
0.7.5-linux-amd64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions