Git Product home page Git Product logo

Comments (2)

maael avatar maael commented on June 16, 2024

Hey again, thanks for the suggestion!

I opted to do two things:

  1. Add the /api/training-courses endpoint in 2939b52. The data under it looks something like this:
[{
    "number": "TC001",
    "technique": "Tsunami",
    "type": "Water",
    "location": "Complete Gone with the Sillaro. Requires the Surfboard.",
    "locationType": "quest"
  },
  {
    "number": "TC002",
    "technique": "Stone Wall",
    "type": "Earth",
    "location": "Windward Fort prison floor, cell in the water. Requires the Surfboard.",
    "locationType": "found"
  }]
  1. In fe63bb4 I made it so the /api/temtems endpoint can take a expand query parameter for a number of fields in the past, including techniques. Now, if you do /api/temtems?expand=techniques, the API will fill out all the technique data, including adding training course information on a trainingCourse key with an item in the same shape as what you'd get a list of from /api/training-courses.

I decided to do it this way, as the dictionary approach, while good for looking up, isn't common convention for an API serving JSON, and makes it more difficult if for example someone wanted to just display a list of all available training courses. But by doing the endpoint as a list, and allowing it to be added by the API where most people would want it, hopefully it achieves what we want.

What do you think?

from temtem-api.

ToddGeorgeKelly avatar ToddGeorgeKelly commented on June 16, 2024

Looks good to me!

from temtem-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.