<p dir="ltr">Cool. Thanks Stuart. You rock!!!</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Oct 3, 2016 8:50 PM, "Stuart Douglas" <<a href="mailto:sdouglas@redhat.com">sdouglas@redhat.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have added it:<br>
<br>
<a href="https://github.com/undertow-io/undertow/commit/a31cd171816f4d70006a64f077fc34ba9c888f4b" rel="noreferrer" target="_blank">https://github.com/undertow-<wbr>io/undertow/commit/<wbr>a31cd171816f4d70006a64f077fc34<wbr>ba9c888f4b</a><br>
<br>
Stuart<br>
<br>
On Tue, Oct 4, 2016 at 11:47 AM, Steve Hu <<a href="mailto:stevehu@gmail.com">stevehu@gmail.com</a>> wrote:<br>
> Hi Miere,<br>
><br>
> Thanks for the answer. I know I can create a patch handler myself but I am<br>
> curious on why this is not implemented as a built-in method like others.<br>
> Also, I have problem to use it if PATCH is not in Methods.java as I am using<br>
> swagger-codegen to scaffold the server stubs from swagger specification the<br>
> first time.<br>
><br>
> Here is the code and as you can see they are following the same pattern for<br>
> the http method. There might be a good reason that PATCH is not implemented,<br>
> but it would be really helpful to add this HttpString into the Methods<br>
> class.<br>
><br>
> Regards,<br>
><br>
> Steve<br>
><br>
><br>
> .add(Methods.PATCH, "/v2/fake", new HttpHandler() {<br>
> public void handleRequest(<wbr>HttpServerExchange exchange) throws<br>
> Exception {<br>
> exchange.getResponseSender().<wbr>send("testClientModel");<br>
> }<br>
> })<br>
><br>
><br>
> .add(Methods.POST, "/v2/fake", new HttpHandler() {<br>
> public void handleRequest(<wbr>HttpServerExchange exchange) throws<br>
> Exception {<br>
> exchange.getResponseSender().<wbr>send("testEndpointParameters")<wbr>;<br>
> }<br>
> })<br>
><br>
><br>
> .add(Methods.GET, "/v2/fake", new HttpHandler() {<br>
> public void handleRequest(<wbr>HttpServerExchange exchange) throws<br>
> Exception {<br>
> exchange.getResponseSender().<wbr>send("testEnumParameters");<br>
> }<br>
><br>
> })<br>
><br>
> On Mon, Oct 3, 2016 at 4:29 PM, Miere Teixeira <<a href="mailto:miere.teixeira@gmail.com">miere.teixeira@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Hi Steve Hu,<br>
>><br>
>> Most of Undertow built-in Handlers expects a HttpString to identify which<br>
>> HTTP Method you intent to handle. Indeed, it does not have a PATCH but I do<br>
>> believe you can easily create your own HttpString with something like the<br>
>> sample code bellow:<br>
>><br>
>> public static final HttpString PATCH = new HttpString("PATCH");<br>
>><br>
>> Also, you can create your own handler, if none of available Handlers fit<br>
>> your needs. It is quite easy... Feel free to e-mail me if you need some help<br>
>> with it.<br>
>><br>
>> Regards,<br>
>><br>
>> On Mon, Oct 3, 2016 at 9:21 AM Steve Hu <<a href="mailto:stevehu@gmail.com">stevehu@gmail.com</a>> wrote:<br>
>>><br>
>>> Hi Tomaz,<br>
>>><br>
>>> Thanks for the quick response. The reason I said undertow doesn't support<br>
>>> PATCH is based on this file.<br>
>>><br>
>>> <a href="https://github.com/undertow-io/undertow/blob/master/core/src/main/java/io/undertow/util/Methods.java" rel="noreferrer" target="_blank">https://github.com/undertow-<wbr>io/undertow/blob/master/core/<wbr>src/main/java/io/undertow/<wbr>util/Methods.java</a><br>
>>><br>
>>> As you can see there is no patch method available and I even searched the<br>
>>> entire source tree with patch keyword.<br>
>>><br>
>>> Steve<br>
>>><br>
>>> On Mon, Oct 3, 2016 at 7:41 AM, Tomaž Cerar <<a href="mailto:tomaz.cerar@gmail.com">tomaz.cerar@gmail.com</a>><br>
>>> wrote:<br>
>>>><br>
>>>> Undertow as server supports all http methods.<br>
>>>> It is up to handlers in handler chain that might choose not to support<br>
>>>> some methods.<br>
>>>> I would look into your handler chain configuration to see which one is<br>
>>>> not handling PATCH properly.<br>
>>>><br>
>>>> --<br>
>>>> tomaz<br>
>>>><br>
>>>> On Sun, Oct 2, 2016 at 9:50 PM, Steve Hu <<a href="mailto:stevehu@gmail.com">stevehu@gmail.com</a>> wrote:<br>
>>>>><br>
>>>>> I am building a REST API framework on top of undertow core to support<br>
>>>>> design driven implementation from Open API (Swagger) specifications for<br>
>>>>> security and validation during runtime. From swagger-codegen result, I found<br>
>>>>> that undertow doesn't support http method PATCH. Is there a reason it is not<br>
>>>>> supported? or any workaround? Thanks.<br>
>>>>><br>
>>>>> <a href="https://github.com/networknt/undertow-server" rel="noreferrer" target="_blank">https://github.com/networknt/<wbr>undertow-server</a><br>
>>>>><br>
>>>>><br>
>>>>> ______________________________<wbr>_________________<br>
>>>>> undertow-dev mailing list<br>
>>>>> <a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
>>>>> <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/undertow-dev</a><br>
>>>><br>
>>>><br>
>>><br>
>>> ______________________________<wbr>_________________<br>
>>> undertow-dev mailing list<br>
>>> <a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
>>> <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/undertow-dev</a><br>
><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> undertow-dev mailing list<br>
> <a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/undertow-dev</a><br>
</blockquote></div></div>