Thank you for the feedback Vladimir.
It would help Tremendously when Exposing rest if we didn't have to create a response object of each instance we want to return. Ideally we would like to have sort of a selection list where we can specify what attributes of each Object is being returned when a request is made.
Let me try and explain this at the hand of an example. We build native mobile apps with A LOT of interfacing with our AwareIM web portal. We have comprehensive API calls that return large sets of data. For instance the App would make an API call to the server to return All Properties for a User.
Properties can have many Leases
Leases Can have many Tenants
So what we currently have to do is something like this (Shorterned & Simplified):
MAIN PROCESS
FIND User WHERE User.ID = ServiceCall.UserID
FIND Property WHERE Property.User=User
--> SUBPROCESS 1 (Called on each property)
CREATE Property_Response WITH PropertyRepsonse.PropertyName=Property.PropertyName,
Property_Response.ServiceCallID=ServiceCall.ID
IF Property.Leases IS DEFINED THEN FIND Leases WHERE Lease IN Property.Leases
SUBPROCESS 2 (Called for Each Lease)
CREATE Lease_Response WITH Lease_Response.Rent=Lease.Rent
INSERT Lease_Response IN Property_Response.Lease_Responses
IF Lease.Tenants IS DEFINED THEN FIND Tenant WHERE Tenant.Lease=Lease
SUBPROCESS 3 (Called for each Tenant)
CREATE Tenant_Response WITH Tenant_Response.Name=Tenant.Name
INSERT Tenant_Response IN Lease_Response.Tenant_Response
BACK TO MAIN PROCESS
FIND Property_Response WHERE Property_Response.ServiceCallID=ServiceCall.ID
This would then return all the properties for a user which then includes the nested relationships for each property's Leases and each leases's Tenants.
Now the Response objects are Can only have one way Peer to Peer relationships downward. IF not the JSON object that is returned will again return the Lease & Property Data for the other tenants as it resolves those relationships.
Hope that makes a bit more sense. What I would expect is that the JSON response would only include The ID of the relationships Unless specified to return the full object of that relationship.
This is a very simple example of the types of processes we need to set up in order to return Nested JSON array structures without returning the same data MULTIPLE times because of the parents resolving again. Also, the main objects might have 20 other relationships to other objects which we don't want to return at all.
I'm not sure what you mean by "There IS already an ability to specify which attributes will be returned" as I don't see anything in the documentation? Perhaps you can give an example of how this works and where one would set that up with regards to my example above.
THEN...
There are already actions to do this (LOGOUT and LOGOUT2) but without a message
Is this only in version 8? I don't see these in 7.1 yet. And also don't see it in Version 8 Documentation that I Have.
Thanks so much for taking the time to hear us all out and consider all the requests. Much appreciated.
Kind Regards
Hein