Skip to content

Incorrect codegen behaviour with nested structure and non-string values inside parameter map #277

@solonovamax

Description

@solonovamax

If you use a nested structure within the parameter map, it will generate invalid code.

Example:

example:
  keys:
    type: string_array

  __map_keys:
    string_value:
      type: string
    
    bool_value:
      type: bool

    nested:
      foo:
        type: int
      bar:
        type: string
      baz:
        type: bool

this will cause it to generate code like:

StackParams get_stack_params() {
  Params params = get_params();
  StackParams output;
  output.__map_keys.nested.foo = params.__map_keys.nested.foo;
  output.__map_keys.nested.baz = params.__map_keys.nested.baz;

  return output;
}

notice how it doesn't have the bar parameter, but it does have the foo and baz parameters.

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