this post was submitted on 29 Jul 2023
1003 points (98.5% liked)
Programmer Humor
32549 readers
473 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Is it just me, or does their sample request use invalid JSON? The keys should be in quotes, comments aren't in spec (but commonly supported), and trailing commas are invalid as well (but commonly supported).
It's only invalid if it generated errors.
But yeah, I typically play it safe and follow the standards. I do wish JSON5 would catch on though.
I understand this line of thinking, but unless they specify what "flavor" of JSON they accept, I think it's safe to assume they only accept what's in spec. What I find weird is that they immediately contradict the spec with their example by writing JavaScript. Should the
content-type
then beapplication/javascript
? They can easily document the parameters outside the request body instead of adding comments.Also, yes, I know I'm being pedantic, but if I'm applying for a job, it's a two way application. They need to give me reason to trust that they're worth working for. Making up rules along the way when referencing a commonly known spec doesn't give me much confidence.
That looks like a JavaScript object. It's not incorrect sytax for a JavaScript object.