How about ?:
MediaType.TEXT_PLAIN_TYPE,
MediaType.APPLICATION_JSON_TYPE,
MediaType.TEXT_XML_TYPE,
MediaType.TEXT_HTML_TYPE
with added application/json (lower in list, higher the priority).
On Apr 15 2021, at 11:01 pm, Subhajit Das <[email protected]> wrote:
> Hi Tim,
>
> It is possible as it is, with simple addition of ResourceComparator. I have
> made one, which selects resource endpoint based on the produce type.
> I am thinking of this order:
> private static final List<MediaType> PRIORITIZED_MEDIA_LIST =
>
>
> Arrays.asList(
>
>
>
> MediaType.TEXT_PLAIN_TYPE,
>
>
>
> MediaType.TEXT_XML_TYPE,
>
>
>
> MediaType.TEXT_HTML_TYPE
>
>
>
> );
>
>
>
>
> Lower (higher index) has higher priority.
> What should be the final list, please suggest.
>
> On Apr 15 2021, at 10:04 pm, Tim Allison <[email protected]> wrote:
> > Can we programmatically specify the default order for ambiguous calls?
> > For example, I recently added a json output for the /tika endpoint,
> > and that is now the default...if the client does not specify "accepts"
> > in the header. That'll be a breaking change, which I don't want.
> >
> > Is the problem the design of our api? Or can we fix this as is...
> > Thank you!
> > Best,
> > Tim
> > On Wed, Apr 14, 2021 at 1:29 PM Subhajit Das <[email protected]>
> > wrote:
> > >
> > >
> > >
> > > Hi,
> > >
> > >
> > >
> > > In Tika server, if a request is made against a REST resource and if it is
> > > matched with multiple resource handler method (like getXML and getText),
> > > then, is there predefined order of resolving method?
> > >
> > > There is always an warning printed, in such case.
> > >
> > > Practically I have seen uncertainty in method.
> > >
> > >
> > >
> > > Thanks and Regards,
> > >
> > > Subhajit Das
> >
>