-
Notifications
You must be signed in to change notification settings - Fork 8
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
Extracting property source. #139
Comments
Hi @agentgt, if you get a moment can you check that PR to check it satisfies the requirement? Note that currently in the PR the Cheers, Rob. |
For the record: that PR is the #140 |
@rob-bygrave I believe so. What I will do is pull the PR and try it against rainbowgum. As minor critique of the PR I would like to see a unit test access |
Ha ha, nice catch. There was such a test but I changed entry() to filter out entries that represent null and yeah looks like I managed to remove the only assert on that when I made that change. |
@rbygrave it appears to work albeit it does not have line number for file based properties like typesafe config. I'm OK with that not being present given avaje-config is for simple properties and that would probably just add bloat. If you don't mind ping me if you guys release this so I can merge the experimental rainbowgum branch into main. Cheers! |
For fun here is an example of rainbowgum working with config PR:
The error messaging is a work in progress but you see here it cannot convert the property
|
While working on Rainbow Gum's generic agnostic property mapping validation and error message I noticed there is no way to get a CoreEntry (or analog).
That is I need the CoreEntry to get the source so that I can build better error messages.
The only way now to get the source information (e.g. like line number) is to use
getAs
which runs your conversion code as aFunction
.Unfortunately I ended up designing Rainbow Gum where that is not really desirable as it creates very confusing call stacks.
What it instead would be easier to some wrapper object like the concrete
CoreEntry
so that you can do something like:Optional<PropertyEntry> getOptionalEntry(String key)
. (and the non optional equivalent if you like). You can bike shed the name PropertyEntry but hopefully you get the idea.In lightbend aka typesafe config the above analog is called
ConfigValue
: https://lightbend.github.io/config/latest/api/com/typesafe/config/ConfigValue.htmlThe text was updated successfully, but these errors were encountered: