Configured Swagger in the project #490
Open
+45
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The Swagger plugin for Javalin is used to configure Swagger. However the annotated endpoints are shown in the Swagger UI but annotations are unable to access any user-defined class in the annotation, as a result, the request format is not shown properly.
Fixes: #478
Changes
The Javalin Openapi plugin is used to generate endpoints' documentation. However the plugin is for Javalin 5 or more, and their documentation suggests to use the javalin-rfc openapi plugin for versions below Javalin 5.
ref: https://github.com/javalin/javalin-openapi/wiki/1.-Installation
For installation this documentation is followed:
https://github.com/javalin/javalin-openapi/tree/99fe1f8eb1df46a1687653bf433d082d7115d426
But the javalin-rfc plugins are located at Reposilite repo. So the build.gradle file in the root is configured to search the Reposilite repo for plugins (ref: https://mvnrepository.com/artifact/io.javalin-rfc/openapi-annotation-processor/1.1.7).
And the OpenApi annotation is used in the request handler to generate docs. However, the annotation is unable to access any user-defiend class in the annotation. As a result, the request format is not generated properly. With further modifications this can be improved. Currently, only the '/createAdapter' endpoint's docs has been created to verify.
ToDo