Reputation: 671
I'm trying to use Apiary to document my API. The URL for the request has parameters that contain objects so the parameter has a square bracket. Here is an example of what the URL path looks like
/api/path-request?filters[created_by]=248766&q=test&sort[0]=name&sortDir[0]=asc&page=2&limit=10
I can't figure out how to get the URL in the documentation to show the brackets correctly. The documentation way of /api/path-request{?filters,q}
gives me ?filters=12345&q=map%20name
.
I also tried /api/path-request?filters[created_by]={filters}&q={q}
but that gives me a URL of /api/path-request?filters[created_by]=filters&q=q
Upvotes: 1
Views: 1847
Reputation: 158
@Michael Turnwall
In Apiary document it is clearly mention that you can create such URL by using documentation in which mention that you can replace the square bracket with percent-encoded. e.g see the example your URL should be.
/api/path-request?filters%5Bcreated_by%5D=248766&q=test&sort%50%5D=name&sortDir%5B0%5D=asc&page=2&limit=10
But FYI, I was facing the same issue the main problem is that you can create the URL as you needed but it will not solve your problem because the server does not support them see here
Upvotes: 3