[prev in list] [next in list] [prev in thread] [next in thread] 

List:       esb-java-dev
Subject:    Re: [Dev] Can we pass a regex as a path param in wso2am 1.10.0?
From:       Shan Mahanama <shanm () wso2 ! com>
Date:       2016-08-31 9:39:16
Message-ID: CAGPJ6CYHPFX15LZMZAOrWTxEa7RYQrDDYxL-pWP7V5wqAEqXkw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Sanjeewa,

Thanks for the clarification.

If we consider REST best practices usually we do use above URL pattern to
> get resource when we know resource ID.
>
>
We have changed the API according to the suggestions and added the search
to already available resource in the micro service.

/products - Get list of all products
/products?query=esb - Get list of products which matches esb

But now, there is another thing we need to clarify. We have added to the
*/products *as the context and added a new URL pattern "/" with query param
named 'query' in the API Manager. So now when we call */products/1.0.0*, we
get list of all products from the micro service. But when we call
*/products/1.0.0?query=esb*, we get the following error message.

<ams:message>No matching resource found in the API for the given
request</ams:message>

But when we add "/" before the query param as shown below, we get the
product list which matches esb.

*/products/1.0.0/?query=esb*

Is this the correct way to do this or do we have to add another resource
here?

Did you tried this with REST API? If so what is the version?
>
> No, we haven't tried this yet.

-- 
Shan Mahanama

Software Engineer, WSO2 Inc. http://wso2.com
<http://l.facebook.com/l.php?u=http%3A%2F%2Fwso2.com&h=gAQEswASa>
Email: shanm@wso2.com
Mobile: +94712000498

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail_extra">Hi Sanjeewa,</div><div \
class="gmail_extra"><br></div><div class="gmail_extra">Thanks for the \
clarification.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div \
class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div \
class="gmail_extra"><div class="gmail_quote"><div>If we consider REST best practices \
usually we do use above URL pattern to get resource when we know resource \
ID.<br></div><div>  <br></div></div></div></div></blockquote><div>We have changed the \
API according to the suggestions and added the search to already available resource \
in the micro service.  </div><div><br></div><div>/products - Get list of all \
products</div><div>/products?query=esb - Get list of products which matches \
esb</div><div>  </div><div>But now, there is another thing we need to clarify. We \
have added to the <b>/products  </b>as the context and added a new URL pattern \
&quot;/&quot; with query param named &#39;query&#39; in the API Manager. So now when \
we call <b>/products/1.0.0</b>, we get list of all products from the micro service. \
But when we call <b>/products/1.0.0?query=esb</b>, we get the following error \
message.</div><div><br></div><div>&lt;ams:message&gt;No matching resource found in \
the API for the given request&lt;/ams:message&gt;<br></div><div><br></div><div>But \
when we add &quot;/&quot; before the query param as shown below, we get the product \
list which matches esb.</div><div><br></div><div><b>/products/1.0.0/?query=esb</b><br></div><div><b><br></b></div><div>Is \
this the correct way to do this or do we have to add another resource \
here?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div \
class="gmail_extra"><div class="gmail_quote"><div></div></div><div \
class="gmail_quote">Did you tried this with REST API? If so what is the \
version?<br><br></div></div></div></blockquote></div>No, we haven&#39;t tried this \
yet.<br><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div \
dir="ltr"><span style="color:rgb(55,62,77);font-family:helvetica,arial,sans-serif;font \
-size:12px;line-height:15.36px;white-space:pre-wrap;background-color:rgb(254,254,254)">Shan \
Mahanama</span></div><div dir="ltr"><br \
style="color:rgb(55,62,77);font-family:helvetica,arial,sans-serif;font-size:12px;line-height:15.36px;white-space:pre-wrap;background-color:rgb(254,254,254)"><span \
style="color:rgb(55,62,77);font-family:helvetica,arial,sans-serif;font-size:12px;line-height:15.36px;white-space:pre-wrap;background-color:rgb(254,254,254)">Software \
Engineer, WSO2 Inc. </span><a \
href="http://l.facebook.com/l.php?u=http%3A%2F%2Fwso2.com&amp;h=gAQEswASa" \
rel="nofollow" style="color:rgb(59,89,152);text-decoration:none;font-family:helvetica, \
arial,sans-serif;font-size:12px;line-height:15.36px;white-space:pre-wrap;background-color:rgb(254,254,254)" \
target="_blank">http://wso2.com</a><br \
style="color:rgb(55,62,77);font-family:helvetica,arial,sans-serif;font-size:12px;line-height:15.36px;white-space:pre-wrap;background-color:rgb(254,254,254)"><span \
style="color:rgb(55,62,77);font-family:helvetica,arial,sans-serif;font-size:12px;line-height:15.36px;white-space:pre-wrap;background-color:rgb(254,254,254)">Email: \
<a href="mailto:shanm@wso2.com" target="_blank">shanm@wso2.com</a></span><br \
style="color:rgb(55,62,77);font-family:helvetica,arial,sans-serif;font-size:12px;line-height:15.36px;white-space:pre-wrap;background-color:rgb(254,254,254)"><span \
style="color:rgb(55,62,77);font-family:helvetica,arial,sans-serif;font-size:12px;line-height:15.36px;white-space:pre-wrap;background-color:rgb(254,254,254)">Mobile: \
+94712000498</span><br></div><div dir="ltr"><span \
style="color:rgb(55,62,77);font-family:helvetica,arial,sans-serif;font-size:12px;line- \
height:15.36px;white-space:pre-wrap;background-color:rgb(254,254,254)"><br></span></div><div \
dir="ltr"><span style="color:rgb(55,62,77);font-family:helvetica,arial,sans-serif;font \
-size:12px;line-height:15.36px;white-space:pre-wrap;background-color:rgb(254,254,254)"><img \
src="http://c.content.wso2.com/signatures/wso2-signature-general.png"><br></span></div></div></div></div>
 </div></div>



_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic