I looked into the implementation before sending the email and also found I&#39;d need to modify WAComplexRoute to match the required path patterns. Didn&#39;t realize I&#39;d need to modify the WARouteContainer too, with your explanation it&#39;s clear why.<br><div><br></div><div>I&#39;ll check what you suggested during the weekend to see if it works.</div><div><br></div><div>Thank you!</div><div><br></div><br><div class="gmail_quote">El Wed Dec 03 2014 at 7:03:44 PM, Philippe Marschall &lt;<a href="mailto:philippe.marschall@gmail.com">philippe.marschall@gmail.com</a>&gt; escribió:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Dec 3, 2014 at 6:30 PM, Esteban A. Maringolo<br>
&lt;<a href="mailto:emaringolo@gmail.com" target="_blank">emaringolo@gmail.com</a>&gt; wrote:<br>
&gt; I&#39;m trying to implement a RestfulHandler to handle search based on a<br>
&gt; variable set of query fields.<br>
&gt;<br>
&gt; E.g.:<br>
&gt; &lt;path: &#39;/api/orders/search?field1=..&amp;<u></u>field2=...&#39;&gt;<br>
&gt;<br>
&gt; The problem is I don&#39;t know the list of fields beforehand, maybe in one<br>
&gt; request I&#39;ll get both field1 &amp; field2, but in others just field1, and/or<br>
&gt; fieldN.<br>
&gt;<br>
&gt; Given the fact that the methods need to have as many parameters as the<br>
&gt; predefined parameters in the path pragma, I couldn&#39;t find a way to define a<br>
&gt; path to match both a request with or without query fields.<br>
&gt;<br>
&gt; something like:<br>
&gt; &lt;path: &#39;/api/orders/search[?<u></u>queryString]&#39;&gt;<br>
&gt;<br>
&gt; Is there a way to this?<br>
<br>
As long as you don&#39;t need/want queryString injection and are fine with<br>
a lookup of the query fields through the request context (IMHO<br>
queryString injection isn&#39;t that useful anyways since it would be<br>
unparsed) it should be possible to update the matching engine to<br>
ignore additional parameter matches if the scoring engine is updated<br>
accordingly. Here&#39;s what you need to change:<br>
- WAComplexRoute &gt;&gt; #matchesParameters:, additional parameters should<br>
be ignored but all parameters in the route have to be present in the<br>
dictionary. Basically remove the size check.<br>
- WARouteContainer &gt;&gt; #initializeWith:, the sorted collection block<br>
needs to be updated to first sort by path priority and then by<br>
parameter priority. This has to work with both WAComplexRoute and<br>
WASimpleRoute. A simple fix would be to split #priority into<br>
#pathPriority (current #priority) and #parameterPriority (number of<br>
parameter matches, 0 for WASimpleRoute) and then first compare by<br>
#pathPriority and then by #parameterPriority. You may want to remove<br>
#priority to make sure you catch all the senders that need to be<br>
updated.<br>
- You need to make sure that you get an error in case of conflicts, eg<br>
in case of<br>
<br>
&lt;path: &#39;/api/orders/search?field1=..&#39;<u></u>&gt;<br>
&lt;path: &#39;/api/orders/search?field2=...<u></u>&#39;&gt;<br>
<br>
and a query string of<br>
<br>
/api/orders/search?field1=..&amp;<u></u>field2=...<br>
<br>
an error should be signaled. If you&#39;re lucky that&#39;s already the case<br>
but likely you&#39;ll have to update<br>
#compareByPathThenContentType:<u></u>thenByAccept: to take #pathPriority and<br>
#parameterPriority into consideration as well.<br>
<br>
Can you try this you and see if it does what you need?<br>
<br>
Cheers<br>
Philippe<br>
______________________________<u></u>_________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.<u></u>squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.<u></u>org/cgi-bin/mailman/listinfo/<u></u>seaside</a><br>
</blockquote></div>