I'm trying to follow best practices for an API, and I'm getting conflicting advice. Most suggest using spinal-case for URI (such as stackoverflow and RFC3986. I have an API that allows filtering on GET requests by various parameters:
GET /endpoint?my-parameter=true
However, I also use the same parameter in GET responses and PATCH requests. There, I see a lot more camelCase or snake_case, and spinal-case is an extra with languages that don't allow hyphens in variable names. So I use this:
{
myParameter: true
}
This seems inconsistent. What's the best practice for handling these cases?