This is a great insight and help Elena! Very much appreciate that.

I will go through the document you shared and will update my status
accordingly.

Thanks a lot!!

Regards,
Vinay

On Mon, Oct 25, 2021 at 8:28 AM Elena Renzi <[email protected]> wrote:

> Hi Vinay,
>
> Adding an example that hopefully will help clarify how the extension
> mechanism could work in your specific use case.
>
> As you said, suppose you want to customize the GET/users endpoint in
> terms of different attributes in the returned response, so for this
> purpose you can define a new REST endpoint which we will call
> MyUsersEndpoint. Now, as per the explanation in the blog article, you
> would need to create a project structure similar to the below:
>
> |ext |
>
> |└── ||MyUsersEndpoint ├── rest-api ├── rest-cxf └── logic |
>
> Where:
> - rest-api would be a JAX-RS annotated interface, that we can call
> MyUsersEndpointInterface
> - rest-cfx would be a CFX-enabled of that interface, that we can call
> MyUsersEndpointInterfaceImpl
> - logic, would be the implementation logic, you can redefine a new
> MyUsersEndpointLogic or using the same UsersLogic implemented in Syncope.
>
> In your case you may be able to customize your HTTP response at the
> level of the rest-cfx implemented interface and reuse the UsersLogic of
> Syncope.
>
> ||
>
> Same procedure can be applied to the other endpoints you want to customize.
>
> Hope it can help!
>
> Best Regards,
>
> Elena
>
>
> ||
>
> Il 25/10/21 11:59, Elena Renzi ha scritto:
> > Hi Vinay,
> >
> > It is not possible to change the payload coming from the endpoints you
> > listed below, but it is possible to extend the standard set of REST
> > services with custom operations. There is an article in the blog that
> > describes the procedure:
> > https://www.tirasa.net/en/blog/add-rest-endpoints-to-apache-syncope-2-0
> >
> > Hope it can help.
> >
> > Best Regards,
> >
> > Elena
> >
> >
> >
> > On 2021/10/22 15:18:25, Vinay Kumar <[email protected]> wrote:
> >
> >   Hi Team,
> >
> > I have a use case in our project where we need to change the Response
> > coming back from a few of the rest calls like below..
> >
> > GET /users
> > POST /users
> > GET /users/{key}
> > POST /users/{key}
> >
> > Is that even possible to send custom responses back from the Rest calls
> > defined above. If it is possible via extensions, is there a doc or an
> > example explaining about the same?
> >
> > The current response has a lot of data which the front-end won't need, so
> > we are just trying to see if we can change the response structure of the
> > Rest calls from Apache Syncope itself via extensions.
> >
> > Thanks in advance for the advice and help!
> >
> > Regards,
> > Vinay
> >
> >
>

Reply via email to