• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Entity filtering for Jax-rs using RestEasy

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am building restful services using rest easy. I have few services which have to address different views of same Model/Resource.

Ex:- Model is Project Short View :- I have to return only few members of the resource Detailed View - I have to return all members of the resource

Want to know if there is jax-rs specification or Rest EASY API to support this. If not please throw some pointers on how to acheive it.

Let me know if i have to provide more background
 
Marshal
Posts: 4813
604
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about different URL paths for Short and Detailed views:
      /projects/{projectId}/views/short-view
      /projects/{projectId}/views/detailed-view
 
Kesava Krishna
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For each path if I need to have a separate operation, since the service functionality is same it might be duplicating the same code into two operations. What do you say?
 
Ron McLeod
Marshal
Posts: 4813
604
VSCode Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Factor-out the common code and put it in a method which is called for both URLs.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic