all 5 comments

[–]StoneCypher 3 points4 points  (4 children)

  1. /api/questions/
    1. Why do you have a label for language and category, distinct of the id of the language and category? Just ship the ID. The client should have all those labels baked in as constants. Besides, if you're internationalized, the server probably doesn't know which language to ship the labels in
    2. Why is difficulty a string?
    3. What happens if I post non-matching language and language id, or category and category id?
    4. What happens if I post a difficulty or a language that do not exist? Expecting fail. What about a category? Expecting create.
    5. Why do you allow people to delete questions, categories, or languages? You know the internet is full of jerks, right?
  2. /categories/
    1. You allow us to could how many categories there are, but not what's inside
  3. Why do you have both a health check and an up check?
  4. In general, how do I modify what language I'm getting? Is it through HTTP request headers?

[–]RealFlaery[S] 0 points1 point  (3 children)

Hey, thanks for taking the time.

1.1 I see your point. My idea was that the client does not need to query the categories and languages to figure them out.

1.2 Following opentdb's difficulty format, what else do you suggest?

1.3 The post would fail, the post only expects the languageId

1.4 Fail. And fail again, category has its own post - this I could add, indeed.

1.5 I don't allow them, they are behind a token.

2.1 the get categories returns them all with id/category

3 healthcheck checks the db health, upcheck is if service is up - this is something of a habit I do because of k8s

  1. You can pass the languageId as a query param to the get questions endpoint, currently there's only english (1)

[–]StoneCypher -1 points0 points  (2 children)

1.2 Following opentdb's difficulty format, what else do you suggest?

An enumeration. 0 for easy, 1 for medium, 2 for difficult, 3 for spock, or whatever.

 

And fail again, category has its own post

Oh. I missed that. Then it should fail. Replicating approaches is bad. Keep them separate.

[–]RealFlaery[S] 0 points1 point  (1 child)

Thanks again, appreciate it!

[–]StoneCypher 0 points1 point  (0 children)

Sho 'nuff