Skip to content
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

Configured Swagger in the project #490

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

muaz-32
Copy link

@muaz-32 muaz-32 commented Apr 16, 2024

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

  • Add the request format
  • Add the response format if possible
  • Add annotations for each endpoint
  • ...

I have used the swagger plugin for Javalin 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.
@muaz-32 muaz-32 mentioned this pull request Apr 16, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant