-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add example configuration for springdoc-openapi-gradle-plugin #134
Add example configuration for springdoc-openapi-gradle-plugin #134
Conversation
09420a9
to
355aee4
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.
Great addition and straight forward to use
String expectedWithoutServersKafkaUrlPatch = IOUtils.toString(expectedStream, StandardCharsets.UTF_8); | ||
String expected = expectedWithoutServersKafkaUrlPatch.replace("kafka:29092", "localhost:29092"); | ||
|
||
InputStream actualStream = this.getClass().getResourceAsStream("/openapi-generated.json"); |
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.
Great. Learning for me, the build folder is also scanned for resources
import java.io.InputStream; | ||
import java.nio.charset.StandardCharsets; | ||
|
||
public class OpenApiGeneratorTest { |
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.
Maybe put a comment that this test is linked to the build.gradle configuration and plugin?
Just to make the link more obvious
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.
I tried to put a comment to explain the connection between the gradle configuration and this test. Does it help?
355aee4
to
684d7fa
Compare
…ngwolf-kafka-example, use springdoc-openapi-gradle-plugin to generate the api spec before test execution and added a test to ensure that the plugin still works for springwolf
684d7fa
to
1ce489c
Compare
Good addition @sam0r040 , thanks for reviewing @timonback |
i.e. A MapSchema is an object, but doesn't have properties
i.e. A MapSchema is an object, but doesn't have properties
Added an example configuration for springdoc-openapi-gradle-plugin to the springwolf-kafka-example to demonstrate how it can be used.
To test and ensure that the plugin still works for springwolf, I also added:
I'm not super happy with the testing part, because there is no way to ignore exception from springdoc-openapi-gradle-plugin. That means that if there is a problem with the application start and the plugin can not get the spec, the build will fail before the tests are executed. If that is not acceptable we can discuss more complex options ie moving this test into its own gradle task that is executed after the tests.