Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport For Matrix Param In Retrofit #2898
Comments
|
That RFC does not define anything about these so-called "matrix" path parameters. It merely states that you may use those characters to delimit sub-segments inside of a single path segment. The link you supply which states the RFC defines anything about path parameters is inaccurate. However, this can already be accomplished by using your own annotation, a Since it's not part of any official HTTP spec and you can build this into Retrofit using its existing extension mechanisms, I'm inclined not to do anything here. |
|
I would welcome this as a sample, in fact. |
Can you provide link to reference documentation which describe how to do it with custom annotation, map and a registered string converter. Or some similar case. |
|
The javadoc for We have a sample which uses a JSON serializer to convert a query param using this mechanism: https://github.com/square/retrofit/blob/00e82dfbe19fd1a9b725b134b70dafe6a0bde8f4/samples/src/main/java/com/example/retrofit/JsonQueryParameters.java |
Both Java Server Side framework for Rest Web Services Spring MVC and Jax Rs have support for Matrix Param.
Retrofit is the poular java and android client for Rest Web Services and don't have support for matrix param. Sound's strange.
Here are the url from java docs of Jax Rs and Spring MVC:
https://docs.oracle.com/javaee/7/api/javax/ws/rs/MatrixParam.html
https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/bind/annotation/MatrixVariable.html
Here is a url to Spring MVC example explaning Matrix param:
https://www.baeldung.com/spring-mvc-matrix-variables
Here is lik to RFC standard explaning matrix variable:
https://tools.ietf.org/html/rfc3986#section-3.3
So please add support for Matrix Variable in Retrofit.