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

Completed Rick and Morty task #208

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

Conversation

AntonZhdanov
Copy link

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.

Your code is well-structured and meets the core requirements of the task! 🎉 The implementation is robust, with comprehensive tests and proper use of Spring and Lombok annotations. The only minor issues are the redundant mapping in CharacterMapper and the restrictive regex in CharacterController. These don't impact functionality but could be improved for clarity and flexibility. Keep up the great work, and consider these enhancements for future iterations! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

Comment on lines +31 to +32
public List<CharacterResponseDto> searchCharacterByName(@RequestParam String name) {
if (!name.matches("[a-zA-Z]+")) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex [a-zA-Z]+ will only match names consisting entirely of alphabetic characters without spaces or special characters. If the intention is to allow names with spaces or other characters, consider updating the regex accordingly.


@Mapper(componentModel = "spring")
public interface CharacterMapper {
@Mapping(source = "externalId", target = "externalId")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mapping @Mapping(source = "externalId", target = "externalId") is redundant because the field names are the same in both the source and target. MapStruct automatically maps fields with the same name, so this line can be removed.

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