-
Notifications
You must be signed in to change notification settings - Fork 308
emplement logic #203
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
base: main
Are you sure you want to change the base?
emplement logic #203
Conversation
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 job on implementing the core functionalities! 🎉 The code meets the task requirements effectively. Just a couple of things to consider: ensure the Swagger configuration matches your package structure for proper API documentation, and refine the random character selection logic to handle potential ID gaps. Keep up the excellent work! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
// public Docket api() { | ||
// return new Docket(DocumentationType.SWAGGER_2) | ||
// .select() | ||
// .apis(RequestHandlerSelectors.basePackage("com.example.rickandmorty")) |
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.
The base package specified here is com.example.rickandmorty
, which might not match your actual package structure. Consider changing it to mate.academy.rickandmorty
to ensure Swagger scans the correct package for API documentation.
if (count == 0) { | ||
return null; | ||
} | ||
long randomId = new Random().nextInt((int) count) + 1; |
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.
The random ID generation logic assumes that IDs are sequential and start from 1, which might not be the case if there are gaps in the ID sequence. Consider using a different approach to select a random character, such as retrieving all IDs and selecting randomly from them.
No description provided.