RE: Resource Type mandatory or optional?

2020-01-10 Thread Stefan Seifert
egeler [mailto:cziege...@apache.org] >Sent: Thursday, January 9, 2020 10:45 PM >To: dev@sling.apache.org >Subject: Re: Resource Type mandatory or optional? > >I looked at some of our provider implementations and all of them make >sure to return a default resource type; so I think we're safe

Re: Resource Type mandatory or optional?

2020-01-09 Thread Carsten Ziegeler
ers Subject: Resource Type mandatory or optional? i've created a ticket concerning the Sling API that the method Resource.getResourceType should be marke das @Nullable, i always thought it was a bug and that the resource type is optional [1]. carsten pointed out that the resource type is mandat

RE: Resource Type mandatory or optional?

2020-01-09 Thread Stefan Seifert
iginal Message- >From: Stefan Seifert [mailto:sseif...@pro-vision.de] >Sent: Thursday, January 9, 2020 2:00 PM >To: Sling Developers >Subject: Resource Type mandatory or optional? > >i've created a ticket concerning the Sling API that the method >Resource.getResourceType shoul

Re: Resource Type mandatory or optional?

2020-01-09 Thread Jason E Bailey
I believe always delivering a resource type is also the right thing to do. It shouldn't be up to the provider of the resource to dictate how the resource is to be rendered. Rather it's up to the Sling implementation. By stating it must return a resource type even if it's the default allows for

Re: Resource Type mandatory or optional?

2020-01-09 Thread Daniel Klco
Agreed with Carsten. Reading the docs and considering how people use the API, all resources should have types, the potential for breaking changes in downstream code if Resource Types are allowed to be nullable is significant. On Thu, Jan 9, 2020 at 8:37 AM Carsten Ziegeler wrote: > Thanks for

Re: Resource Type mandatory or optional?

2020-01-09 Thread Carsten Ziegeler
Thanks for the pointer, Konrad: that page clearly states: "Each resource has a resource type which is used by the Servlet and Script resolver to find the appropriate Servlet or Script to handle the request for the Resource." The javadocs are not very precise, but they do not mention that it

Re: Resource Type mandatory or optional?

2020-01-09 Thread Konrad Windszus
One more clarification: Via the implicit resource super type "sling/servlet/default" technically each resource has a resource type which is used for rendering resources. > On 9. Jan 2020, at 14:09, Konrad Windszus wrote: > > I tend to agree with the statement that the resource type should be

Re: Resource Type mandatory or optional?

2020-01-09 Thread Konrad Windszus
I tend to agree with the statement that the resource type should be optional. Not every resource should be rendered and having no resource type set on those resources feels natural to me. Enforcing a non-null resource type for every resource is more complicated as each resource provider must be

Resource Type mandatory or optional?

2020-01-09 Thread Stefan Seifert
i've created a ticket concerning the Sling API that the method Resource.getResourceType should be marke das @Nullable, i always thought it was a bug and that the resource type is optional [1]. carsten pointed out that the resource type is mandatory. the javadocs are not precise on this, i've