Blueprint (XML DSL) in Apache Camel does not let me use PATCH

36 Views Asked by At

I want to use a PATCH verb for my endpoint but I keep getting errors.

I'm replacing some of the links because SO is not letting me post the message because the filter thinks this is spam and I'm adding a pastebin link because I can't post the XML in any other way.

From what I've seen, my Camel version (2.15.1.redhat-621084) supports using PATCH (older versions prior to 2.11.X didn't allow it, from what I've read), although that shouldn't even be an issue because I think the problem is with the XML validation itself.

IntelliJ also warns me that I can't use PATCH there.

The error I have when I start the bundle in Fuse (karaf) is:

Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'patch'. One of '{"http://camel.apache.org/schema/blueprint":verb, SAMEURL:delete, SAMEURL:get, SAMEURL:head, SAMEURL:post, SAMEURL:put}' is expected.

My blueprint.xml (with some information redacted) is https://pastebin.com/rd3Ukj65

I can get it to work if I change the endpoint definition to

            <verb
                    uri="/users/{userId}/X"
                    method="PATCH"
                    produces="application/json"
            >
                <to uri="direct:updateX"/>
            </verb>

But I shouldn't have to define a new verb just to use a patch.

Can someone help me out understanding what I'm missing here?

1

There are 1 best solutions below

0
Claus Ibsen On

No this is correct in that old Camel version. PATCH was not included at the time, and you can use the generic verb to define it yourself