As mentioned in the azure document for app registration, I was able to create connector for sharepoint rest api.
I tested the custom connector in powerapps for the rest api URL /sites/{sitename}/_api/web/getuserbyid({userid})/groups and I got all the sharepoint groups associated with the user and the response in JSON format.
When I tried to use the connector in powerapps and after passing all the required parameter.(sitename and userid). The output that is returned is always in xml and powerapps is not able to parse xml.
I did mention in the swagger file to produce and consume json. In the network console I could see they are using proxy url as shown below and response always shows xml
Network console
Swagger description
https://msmanaged-na.azure-apim.net/apim/spapi.5f79410ce145b.5f7edfa0cdba0c396b/399ed19282a847568e504a8e8ca0/sites/SharepointSandbox/_api/web/getuserbyid%2813%29/groups
How do I get the JSON format as a response ? This solution would help me to maintain user roles in sharepoint site