Skip to content

Hardcoded support for boolean converter#17

Merged
angelozerr merged 1 commit intoeclipse-lsp4mp:masterfrom
datho7561:298-hardcoded-coolean-converter
Aug 31, 2020
Merged

Hardcoded support for boolean converter#17
angelozerr merged 1 commit intoeclipse-lsp4mp:masterfrom
datho7561:298-hardcoded-coolean-converter

Conversation

@datho7561
Copy link
Copy Markdown
Contributor

@datho7561 datho7561 commented Jul 21, 2020

Boolean validator now supports 'Y', 'YES', '1', 'ON'. The error message for an invalid boolean value now displays a warning that the value will be automatically interpreted as 'false'.

Closes redhat-developer/quarkus-ls#298

Signed-off-by: David Thompson davthomp@redhat.com

@datho7561
Copy link
Copy Markdown
Contributor Author

Screenshot from 2020-07-21 10-09-25

As mentioned above, I modified the error message to reflect the fact that, by default, unrecognised boolean values are interpreted as false by microprofile. Let me know if this change doesn't make sense to add.

@datho7561 datho7561 force-pushed the 298-hardcoded-coolean-converter branch from 0585c8b to d535cfe Compare July 21, 2020 14:37
@datho7561 datho7561 marked this pull request as ready for review July 21, 2020 14:38

private static boolean isBooleanString(String str) {
return "true".equals(str) || "false".equals(str);
return "true".equals(str) || "false".equals(str) || "Y".equals(str) || "YES".equals(str) || "1".equals(str) || "ON".equals(str);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have the check be case insensitive? If the value is oN, on, TrUE, yes etc., according to https://github.com/eclipse/microprofile-config/blob/master/spec/src/main/asciidoc/converters.asciidoc#built-in-converters we should still consider those to be true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Forgot to look into this.

@xorye
Copy link
Copy Markdown

xorye commented Jul 21, 2020

Works well on my machine, with Quarkus

@datho7561 datho7561 force-pushed the 298-hardcoded-coolean-converter branch from d535cfe to 2b45101 Compare July 21, 2020 19:43
@fbricon
Copy link
Copy Markdown
Contributor

fbricon commented Aug 28, 2020

@datho7561 please fix the conflict

Boolean validator now supports 'Y', 'YES', '1', 'ON'.
The error message for an invalid boolean value now displays
a warning that the value will be automatically interpreted as 'false'.
Closes eclipse-lsp4mp#298

Signed-off-by: David Thompson <davthomp@redhat.com>
@datho7561 datho7561 force-pushed the 298-hardcoded-coolean-converter branch from 2b45101 to 3b530ba Compare August 28, 2020 13:10
@datho7561
Copy link
Copy Markdown
Contributor Author

rebased

@angelozerr angelozerr merged commit e242768 into eclipse-lsp4mp:master Aug 31, 2020
@angelozerr angelozerr added the enhancement New feature or request label Sep 11, 2020
@angelozerr angelozerr added this to the 0.1.0 milestone Sep 11, 2020
@datho7561 datho7561 deleted the 298-hardcoded-coolean-converter branch July 19, 2021 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for boolean converter

5 participants