Should [ ] be escaped in response links?

The consumer ultimately will need to be responsible for some amount of percent encoding of the brackets, e.g. sparse fieldsets in a query. However, if the consumer is simply following or applying a link, it should not require any processing from the consumer side.

I apologize if my previous response was unclear. Stating it a little differently, any URL you return which contains any character in the reserved set of RFC3986 is required to be percent encoded. The URL of hypermedia should be opaque to the consumer, you should not spend effort to make the link ‘href’ human readable.

If your concern is human readability, your focus should be on learning about and leveraging a hypermedia vocabulary for the services human readability, interactability, and interoperability. Take a look at my Hypermedia API Guidelines for a bit of information on the topic.

1 Like