-
Notifications
You must be signed in to change notification settings - Fork 91
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
Added property config query-config-enabled #1366
Conversation
ui/open-api-ui/src/test/java/io/smallrye/openapi/ui/IndexCreatorTest.java
Outdated
Show resolved
Hide resolved
eb599d0
to
a487570
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mfpc there is a formatting issue. You should be able to just run mvn package
locally and commit the formatting changes to resolve this.
ui/open-api-ui/src/test/java/io/smallrye/openapi/ui/IndexCreatorTest.java
Outdated
Show resolved
Hide resolved
ui/open-api-ui/src/main/java/io/smallrye/openapi/ui/IndexHtmlCreator.java
Outdated
Show resolved
Hide resolved
ui/open-api-ui/src/test/java/io/smallrye/openapi/ui/IndexCreatorTest.java
Outdated
Show resolved
Hide resolved
ui/open-api-ui/src/test/java/io/smallrye/openapi/ui/IndexCreatorTest.java
Outdated
Show resolved
Hide resolved
2795c05
to
9195684
Compare
Hi, I have a question, when I use this code DEFAULT_OPTIONS.put(Option.queryConfigEnabled, null); my test fail assertTrue(s.contains("queryConfigEnabled")); If I change to DEFAULT_OPTIONS.put(Option.queryConfigEnabled, "false"); it works. Should I fix this or remove this test? Thank you |
@@ -31,6 +32,8 @@ void testCreateDefault() throws IOException { | |||
assertTrue(s.contains("<img src='logo.png' alt='SmallRye OpenAPI UI'")); | |||
assertTrue(s.contains("dom_id: '#swagger-ui',")); | |||
assertTrue(s.contains("deepLinking: true,")); | |||
assertTrue(s.contains("queryConfigEnabled")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If queryConfigEnabled
is unset shouldn't it not be present in the resulting content ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, then it falls back to the default of swagger-ui. So if it's not set (default null) it should not be in the html. So a correct test would be that it's not there. Then when it's set to true or false, it should be there with the value
@@ -31,6 +32,8 @@ void testCreateDefault() throws IOException { | |||
assertTrue(s.contains("<img src='logo.png' alt='SmallRye OpenAPI UI'")); | |||
assertTrue(s.contains("dom_id: '#swagger-ui',")); | |||
assertTrue(s.contains("deepLinking: true,")); | |||
assertTrue(s.contains("queryConfigEnabled")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, then it falls back to the default of swagger-ui. So if it's not set (default null) it should not be in the html. So a correct test would be that it's not there. Then when it's set to true or false, it should be there with the value
Co-Authored-By: George Gastaldi <gegastaldi@gmail.com>
0cecc0d
to
288a53d
Compare
All adjust done. |
LGTM. Thanks |
Kudos, SonarCloud Quality Gate passed! |
@MikeEdgar if you are happy you can merge :) |
Added property config query-config-enabled