Skip to content

Make GetContextValue() and GetUnstructValue() behaviour consistent when field does not exist #37

@colmsnowplow

Description

@colmsnowplow

GetUnstructValue() returns an error when the path provided doesn't exist, whereasGetContextValue() returns nil with no error.

I believe these were simply two API design choices that were made independently, and there's good reason for these in isolation to behave this way - for contexts, there can be several of the same context - some of which may contain an optional field whereas some don't. In that case, we don't want to error if we find one but not the other.

We should reconsider whether or not this is the best design, since it's unintuitive - one would expect these to behave in something of a consistent manner.

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