MNuenninghoff / NPCCreator

NPC description generator
0 stars 0 forks source link

Week-9-Exercise #6

Closed MNuenninghoff closed 3 weeks ago

MNuenninghoff commented 2 months ago

@pawaitemadisoncollege The week 9 exercise is ready for review.

  1. Key learning points

    • It is best practice to respond with JSON
    • Following naming conventions for URIs helps with ease of use for the service
  2. Challenges

    • I realized that if the service was given an id for a talent that was not in the database, the result was a 500 internal server error. I wanted change that to a 404 not found error instead. I added a try-catch block and built a response with a 404 status in the event of a null pointer exception.
  3. Resources

pawaitemadisoncollege commented 2 months ago

Hi @MNuenninghoff! This is a good first go at creating a restful service with java code. You did a nice job with best practices related to naming - something that many miss! This work should set you up really well for the team project.

One thing: the Jackson library can help make it easier to turn a java object into json: https://www.baeldung.com/jackson-object-mapper-tutorial. Here they are writing to a file, but I think you'll get the idea!