Skip to content

Implement Yaml Deserializer #4396

@ysolomchenko

Description

@ysolomchenko

Blocked by

Description

Implement a YAML deserializer with extended functionality to support environment variable substitution and proper handling of default values.

Acceptance Criteria

  • The deserializer should accept standard primitive and object values.
  • The deserializer must not fail when encountering fields that do not exist in the target class and should handle them gracefully.
  • The deserializer should support environment variable substitution in the form ${ENV_VAR}.
  • The deserializer should support environment variable substitution with a default fallback in the form ${ENV_VAR:-value}, where value is used if ENV_VAR is null.
  • The deserializer should allow creating an object with a default value from an empty YAML node, even if the property type is nullable.

Example:

field:
public class Configuration 
{
    [YamlMember(Alias = "field")]
    public FiledClass? Field{ get; set; } = new();
}
Expected output:

Field is instantiated with its default value.

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