Skip to content

Conversation

@RiceViz
Copy link
Contributor

@RiceViz RiceViz commented Oct 5, 2025

This PR adds Web API's to make HTTP calls "GET", "POST" and "DELETE" for Media Items.

Lessons Learned:

  • How to navigate large projects and how web requests work with large applications
  • API calls when it comes to Java and SpringBoot

Challenges:

  • Specifically got stuck on "POST" for a while. After reading tests I learned it wanted a Map of the media item and not the media item itself. Also had to validate the bad request (not sure what that exactly means).
  • Used AI to ask questions about how to tackle the problem. Got a lot of insight on API calls. AI also led me on the wrong path of changing other files.

@RiceViz RiceViz changed the title feat: adds "GET", "POST", and "DELETE" request for Media Items feat: adds Tyran's "GET", "POST", and "DELETE" request for Media Items Oct 7, 2025
Copy link
Contributor

@anthonydmays anthonydmays left a comment

Choose a reason for hiding this comment

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

🎓 Automated Grading Report

Student: Tyran Rice
Date: 10/7/2025

Feedback

The submission demonstrates a good understanding of APIs and the HTTP protocol by implementing the required endpoints in the MediaItemsController.java file. The student has correctly added the necessary imports and annotations to handle HTTP requests. The getItemsById, addItem, and deleteItem methods have been implemented to interact with the library and respond with appropriate HTTP responses. However, there are some discrepancies compared to the sample solution. For instance, the getItemsById method returns a GetMediaItemsResponse instead of a MediaItemResponse, which is inconsistent with the sample solution. Additionally, the addItem method returns a Map<String, MediaItemResponse> instead of a CreateMediaItemResponse, which deviates from the expected response structure. These differences may affect the functionality and compatibility with existing unit tests. Technically, the code is mostly well-formatted and syntactically correct, but there are minor inconsistencies in the response types and exception handling. Overall, the submission meets most of the functional and technical requirements but could benefit from aligning more closely with the sample solution.


This is an automated preliminary review. Please review and adjust before finalizing.

@anthonydmays anthonydmays reopened this Oct 8, 2025
}

@GetMapping("/items/{id}")
public ResponseEntity<GetMediaItemsResponse> getItemsById(@PathVariable String id) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be getItemById and should just return a MediaItemResponse.

Map<String, MediaItemResponse> response = Map.of("item", responseItem);

return ResponseEntity.ok(response);
} catch (IllegalArgumentException e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't need this

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