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