-
Notifications
You must be signed in to change notification settings - Fork 115
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
Must a Config actually use Converters? #448
Comments
The behavior of converters is more or less laid out here: https://github.com/eclipse/microprofile-config/blob/master/spec/src/main/asciidoc/converters.asciidoc I've proposed the following improvements/clarifications to the JavaDoc: https://github.com/eclipse/microprofile-config/pull/445/files#diff-cba20e499de1f727fdbf90650c680ce9R36 (see the result here: microprofile-config/api/src/main/java/org/eclipse/microprofile/config/spi/Converter.java Lines 35 to 108 in 74a8c9f
I would agree that at the very least there needs to be a |
I truly understand the intent, I really do. But I urge you and others to read the specification with "robot implementor" eyes. Here, for example, I don't think there is anything that says when I think my main beef in this area in particular is that I can probably implement I always look to the CDI specification as a good example that splits the difference between having an answer for everything where one is needed, readability, and clear identification of where implementations may do what they wish. I find nothing like that in this specification in many different areas and have been trying to file issues (as advised) where I've noticed gaps so that in my own implementation I can document all the non-specified choices I've had to take as an implementor with references to this project's issue board. |
@ljnelson
What does "underlying" mean? The above sentence means the config object constructed via the Builder pattern where you supplied the converters. I am not sure how useful it is to list the converters at all. Can you explain why do you need this method? |
But there is no requirement that the converters supplied to the builder are actually used by the |
In the
I think it is meant to say "override" not "overwrite". In a follow-up section it says:
I think this implies that custom converters will be used for a given type if available. But I agree again that the spec language is not clear and needs refinement. |
@dmlloyd please come up with a PR to clarify this. |
@dmlloyd I'm going to create a PR for this in a minute so that it can be included in the Config 1.4 release. |
I've been working on an overarching JavaDoc cleanup PR which I hope to submit today, but there will likely be conflicts. |
…ent improvements. This works towards eclipse#447 and also will make it easier to specify eclipse#448, eclipse#426, etc.
…ent improvements. This works towards eclipse#447 and also will make it easier to specify eclipse#448, eclipse#426, etc.
What was the final result here? Was the specification text altered? |
The
Config
interface of course does not refer to them at all.The
ConfigBuilder
interface accepts them but there does not seem to be a requirement anywhere I can find that theseConverter
s actually be used by aConfig
implementation.By contrast,
ConfigSource
s, which are also accepted by aConfigBuilder
, clearly show up in theConfig
interface (although they give rise to another issue whose comment section apparently augments the specification).The specification around Converters also mentions, at the bottom:
What does "underlying" mean?
Also this implies that an autocloseable
Converter
must be used in some unspecified way by exactly oneConfig
instance, or it will be at risk of being closed improperly from the viewpoint of some otherConfig
instance. This doesn't seem to be spelled out anywhere.For clarity: clearly I understand the intent is that conversion must happen using
Converter
instances during theConfig#getValue(String, Class)
method in some hazy way. But it seems to me there is no such requirement anywhere.If such conversion must be used, is it reasonable to provide a
getConverters()
method onConfig
, much as there is agetConfigSources()
method onConfig
?Is it therefore also reasonable to suggest that there be a full specification of how conversion must behave when the
getValue(String, Class)
andgetOptionalValue(String, Class)
methods are invoked?The text was updated successfully, but these errors were encountered: