Skip to content

Conversation

qreqit
Copy link

@qreqit qreqit commented Nov 10, 2024

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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"))

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;

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.

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.

2 participants