-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Enum property values not hyphenated anymore in the configuration metadata #42514
Comments
/cc @radcortez (config) |
cc @gsmet |
Yeah, I have ported this rule from the existing code base. Now what I don't understand is why you had the previous behavior. I'll have a look later today. |
I think the only reason why it wasn't hyphenated is that when We are a lot more consistent now. Not entirely sure what's best but really hyphenating when having a converter that is not the default is probably a bad idea. Is there a reason why you have a converter here? |
Haha, yes, IIRC it's only because earlier it was not possible to persuade Quarkus not to hyphenate the enum values in the metadata so I had to introduce a way to map what users got in the docs to the real values. Another detail that makes this case a bit harder is that the enum comes from CXF, so I cannot annotate it with It is only a single property on Quarkus CXF side having this issue (but I have not looked into Camel yet) and I actually agree not-hyphenating makes sense if there is It would be great to have a way to adjust the presented values somehow. Maybe a new
|
Maybe an annotation to force the hyphenation would be a bit more sustainable from a maintenance POV? |
Yes, that would solve the current issue, but a general way to document accepted values (even for non-enums) would come in handy, wouldn't it? How about this?
|
I mean |
Anyway, if all the above is too complicated, given that I need this in just a single case, I can also workaround it by wrapping the CXF enum in a local one and use |
I did that right now and I'd be fine with closing this issue unless you see some value in handling this in a general manner? |
For now I think I would start with |
I'm working on a patch. |
Also refactor things a bit to centralize the handling of the common annotations. Fixes quarkusio#42514
Also refactor things a bit to centralize the handling of the common annotations. Fixes quarkusio#42514
Also refactor things a bit to centralize the handling of the common annotations. Fixes quarkusio#42514
Describe the bug
We have a config property in Quarkus CXF defined as follows:
Before the recent refactoring of
quarkus-extension-processor
, the metadata was produced with hyphenated enum valuestarget/asciidoc/generated/config/all-configuration-roots-generated-doc/io.quarkiverse.cxf.CxfConfig
:After the refactoring, the enum values in
target/quarkus-config-doc/quarkus-config-model.yaml
are present verbatim:Expected behavior
The enum values should be produced hyphenated, same as before quarkus-extension-processor refactoring.
I am aware of the following note in ConfigResolver
quarkus/core/processor/src/main/java/io/quarkus/annotation/processor/documentation/config/resolver/ConfigResolver.java
Lines 155 to 156 in baf77db
However my example proves that the rule to decide about hyphenation must have been complexer than just "if the property has a converter"
The text was updated successfully, but these errors were encountered: