Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent empty/missing value handling (use case) #532

Closed
1 of 4 tasks
dmlloyd opened this issue Mar 6, 2020 · 0 comments · Fixed by #598
Closed
1 of 4 tasks

Consistent empty/missing value handling (use case) #532

dmlloyd opened this issue Mar 6, 2020 · 0 comments · Fixed by #598
Labels
use case 💡 An issue which illustrates a desired use case for the specification

Comments

@dmlloyd
Copy link
Contributor

dmlloyd commented Mar 6, 2020

Description

Empty and missing value handling is not consistent. The inconsistency is characterized by special treatment of certain configuration types, particularly array and String, which produce somewhat bizarre effects when retrieving empty values compared to missing values. Special cases in general APIs lead to confusion and frustrating limitations.

Some value types, such as collections, arrays, and strings, have a "natural" empty representation. However some value types do not. In some cases (like primitive values), no such representation is possible, where in other cases, null is the only possible representation. There should be one value that can represent empty for any value type, whether it is a collection, simple object, or primitive type.

As a:

  • Application user/user of the configuration itself
  • API user (application developer)
  • SPI user (container or runtime developer)
  • Specification implementer

...I need to be able to:

  • Have a consistent experience handling values that are empty or missing that does not need to vary depending on the conversion type
  • Detect that a property is empty regardless of its type
  • Decode an empty value into the target type in a way that is appropriate for the use site
  • Not be concerned with whether a collection with a given element type can or cannot contain an empty value

...which enables me to:

Simplify my experience and apply patterns for empty values to any value type, and enable property clearing (#531).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
use case 💡 An issue which illustrates a desired use case for the specification
Projects
None yet
1 participant