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

String inline array property - more flavors? #382

Open
ljacqu opened this issue Sep 15, 2023 · 0 comments
Open

String inline array property - more flavors? #382

ljacqu opened this issue Sep 15, 2023 · 0 comments

Comments

@ljacqu
Copy link
Member

ljacqu commented Sep 15, 2023

I've changed the inline array property type to also consider a final empty entry if the string ends with the separator. This is only (really) relevant for the string type, where the following string:

"test
test
" // <-- empty line

previously produced an array ["test", "test"]—now, it produces ["test", "test", ""].

I think this is more consistent. In the scope of this change, though, some general thoughts about the inline array type came up:

  • it would make sense to provide an inline array type implementation for string out of the box that trims entries and ignores empty entries
  • maybe it would be good to have a StringInlineArrayPropertyType extension altogether with a few different flavors
  • how to handle StringType#inlineArrayType? "useTrimAndSpaces" is hard-coded to false at the moment.

Unfortunately, searching over the entirety of GitHub for "InlineArrayConverter" (the pre-ConfigMe 2 name) does not show any usages of the inline array. I have trouble seeing use cases for this type, besides a) if you want to comma-separate a few values and not take too much space in the config file; or rather, b) some file formats don't support collections (like .properties)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant