Adam Cameron
<http://example.com/path/to/something?SomeParam=x> vs <http://example.com/path/to/something?someparam=x>, vs <http://example.com/path/to/something?some_param=x>, vs <http://example.com/path/to/something?some-param=x>.
I know the accepted recommendation for the path part is kebab case. I'm specifically looking at the query string parameter names.
I can't stress enough I don't give a shit what your personal opinion is (I already have that covered). I'm looking for guidelines. I'm drawing a blank on google.Patrick
02/14/2024, 4:36 PMPatrick
02/14/2024, 4:36 PMPatrick
02/14/2024, 4:38 PMScott Bennett
02/14/2024, 4:41 PMrstewart
02/14/2024, 4:42 PMAdam Cameron
snake_case (for poorly-thought-out reasons, but we're stuck with it) for its variables, and it's talking to our API (new, under development now), which uses camelCase.
We've just added a new endpoint and integrating it back into the old system, and we've used ?my_param=value, whereas my take would be "no that's legacy, we're not perpetuating that... use ?myParam=value.
But then I started thinking even MORE about it, and wondering if there's firm guidelines.
I suspect there is not.quetwo
02/14/2024, 4:44 PMAdam Cameron
Where does the "I know the accepted recommendation for the path part is kebab case." come from?Ppl used to have to type urls and can't remember casing, plus
_ tends to get subsumed in a hyperlink underline or confused for a space, so - became the recommendation.rstewart
02/14/2024, 4:45 PMAdam Cameron
Patrick
02/14/2024, 4:51 PMrstewart
02/14/2024, 4:53 PMrstewart
02/14/2024, 4:55 PMaliaspooryorik
rstewart
02/14/2024, 4:56 PMAdam Cameron
From a corporate standpoint,100%. I am the corporate part in this case (not the dev), but this is the first instance of this Q coming up in an API that is going to grow a lot, so I want to have the discussion now, and then move on. And, fwiw, I have said "it's not enough to hold up the code going out the door if no clear answer surfaces quickly"
Patrick
02/14/2024, 5:03 PMquetwo
02/14/2024, 5:03 PMAdam Cameron
Adam Cameron
Mark Takata (Adobe)
02/14/2024, 5:23 PMScott Bennett
02/14/2024, 5:24 PMAdam Cameron
first.second=value where it converts that to a struct. FFS.
Not sure PHP would do what you said, but if it was back in its old days... wouldn't surprise me.Mark Takata (Adobe)
02/14/2024, 5:31 PMScott Bennett
02/14/2024, 5:32 PMScott Bennett
02/14/2024, 5:35 PMPatrick
02/14/2024, 5:56 PMseancorfield
I and l for example (capital i and lowercase l).
At a minimum, make sure they are not case-sensitive was also seemingly the consensus.seancorfield
rstewart
02/14/2024, 11:10 PMAdam Cameron
/subthing/thing=1 (filter) vs /thing/1/subthing/ (subcollection) and went "doh... yeah next time", but I'm OK positioning it as a filter for now. Although it should be the latter.