Re: PATCH support in SlingAllMethodsServlet

2021-12-17 Thread Radu Cotescu
Hi Julian,

> On 17 Dec 2021, at 16:45, Julian Reschke  wrote:
> 
> OTOH, *if* Sling adds specific support for PATCH, it would be good if it
> made it clear that it's really different from POST in what the payload's
> semantics are (and that if you are using a format not defined with PATCH
> semantics, you're doing it wrong).

In this particular case I just want the plumbing code in the servlet, so that 
an application that supports PATCH doesn’t need to write the boilerplate for 
each servlet that wants to process a PATCH request.

The semantics IMO are each application’s concern, since there are multiple ways 
to implement support for PATCH, depending on the media/document type.

Thanks,
Radu

Re: PATCH support in SlingAllMethodsServlet

2021-12-17 Thread Julian Reschke

Am 17.12.2021 um 14:14 schrieb Carsten Ziegeler:

Interestingly even servlet api 5 has no notion of patch

(https://javadoc.io/doc/jakarta.servlet/jakarta.servlet-api/latest/jakarta/servlet/http/HttpServlet.html)
...


Well, the set of method names in HTTP is extensible, and the servlet API
really doesn't need to support it.

OTOH, *if* Sling adds specific support for PATCH, it would be good if it
made it clear that it's really different from POST in what the payload's
semantics are (and that if you are using a format not defined with PATCH
semantics, you're doing it wrong).

Best regards, Julian


Re: PATCH support in SlingAllMethodsServlet

2021-12-17 Thread Bertrand Delacretaz
On Fri, Dec 17, 2021 at 2:14 PM Carsten Ziegeler  wrote:
> Interestingly even servlet api 5 has no notion of patch ...

Interesting indeed...and we might have a similar problem soon if (like
I hope) QUERY [1] becomes a thing.

-Bertrand

[1] 
https://www.ietf.org/archive/id/draft-ietf-httpbis-safe-method-w-body-02.html


Re: PATCH support in SlingAllMethodsServlet

2021-12-17 Thread Carsten Ziegeler

Interestingly even servlet api 5 has no notion of patch

(https://javadoc.io/doc/jakarta.servlet/jakarta.servlet-api/latest/jakarta/servlet/http/HttpServlet.html)

Regards
Carsten

Am 17.12.2021 um 13:52 schrieb Bertrand Delacretaz:

Hi Radu,

On Fri, Dec 17, 2021 at 1:46 PM Radu Cotescu  wrote:

... Adding a method to this class should be a minor change to the API, unless 
I’m missing something...


I was thinking of potential problems if classes have inherited from
SlingAllMethodsServlet and added their own mechanism to handle PATCH.
But if they've done that correctly that shouldn't be a problem. Or at
least I cannot think of a concrete case where this might be a problem.

-Bertrand


--
Carsten Ziegeler
Adobe
cziege...@apache.org


Re: PATCH support in SlingAllMethodsServlet

2021-12-17 Thread Bertrand Delacretaz
Hi Radu,

On Fri, Dec 17, 2021 at 1:46 PM Radu Cotescu  wrote:
>... Adding a method to this class should be a minor change to the API, unless 
>I’m missing something...

I was thinking of potential problems if classes have inherited from
SlingAllMethodsServlet and added their own mechanism to handle PATCH.
But if they've done that correctly that shouldn't be a problem. Or at
least I cannot think of a concrete case where this might be a problem.

-Bertrand


Re: PATCH support in SlingAllMethodsServlet

2021-12-17 Thread Radu Cotescu
Hi Bertrand,

Adding a method to this class should be a minor change to the API, unless I’m 
missing something.

> On 17 Dec 2021, at 12:08, Bertrand Delacretaz  wrote:
> 
> I don't see why we wouldn't support it, as long as we keep backwards
> compatibility in mind.

Thanks,
Radu



Re: PATCH support in SlingAllMethodsServlet

2021-12-17 Thread Radu Cotescu
I was afraid of that. Thanks! :D

> On 17 Dec 2021, at 12:13, Carsten Ziegeler  wrote:
> 
> I think patch was officially added around 2010, so our code probably predates 
> that



Re: PATCH support in SlingAllMethodsServlet

2021-12-17 Thread Carsten Ziegeler
I think patch was officially added around 2010, so our code probably 
predates that


Regards
Carsten

Am 17.12.2021 um 11:58 schrieb Radu Cotescu:

Hello,

I couldn’t find this anywhere (JIRA/mail archives), so I need to query the Borg 
Collective: is there a specific reason for which we haven’t yet added support 
for PATCH in SlingAllMethodsServlet [0]?

Thanks,
Radu

[0] - 
https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java


--
Carsten Ziegeler
Adobe
cziege...@apache.org


Re: PATCH support in SlingAllMethodsServlet

2021-12-17 Thread Bertrand Delacretaz
Hi,

On Fri, Dec 17, 2021 at 11:59 AM Radu Cotescu  wrote:
> ...is there a specific reason for which we haven’t yet added support for PATCH
> in SlingAllMethodsServlet [0]?...

I don't see why we wouldn't support it, as long as we keep backwards
compatibility in mind.

-Bertrand