15Dkatz / official_joke_api

Official Joke API!
https://davidtkatz.com
MIT License
842 stars 348 forks source link

Inconsistent JSON Format Returned #70

Closed aalshibily closed 2 years ago

aalshibily commented 3 years ago

Hi,

I was playing around with the API and I noticed that for a single random joke and a random type joke I was getting JSON but in inconsistent formats.

Example:

Totally random via [https://official-joke-api.appspot.com/jokes/random](this link) {"id":364,"type":"general","setup":"Why do pirates not know the alphabet?","punchline":"They always get stuck at \"C\"."} Type Random via [https://official-joke-api.appspot.com/jokes/programming/random](this link) [{"id":28,"type":"programming","setup":"To understand what recursion is...","punchline":"You must first understand what recursion is"}]

It's probably a minor fix but I just wanted to point it out.

Love the API btw!

UltiRequiem commented 3 years ago

This problem is fixed on https://github.com/UltiRequiem/joke

15Dkatz commented 2 years ago

I commented on this inconsistent format here: https://github.com/15Dkatz/official_joke_api/issues/48. Unfortunately, I'm deciding to keep the format to support a course that I made, that is using this inconsistent format. Future client-side applications can get around this by implementing a condition that recognizes this endpoint's odd return format.