Hi,

I think what Dushani suggested is to include some essential application or
API fields in subscription response. For example: sending the name of the
API, version and provider as APIInfo and name of the application and the
app creator as the application info. When someone trying to list down
subscriptions, we essentially need to show the above information; so
including those essential fields in the subscription DTO itself might be OK
in my opinion.

On Wed, Jul 4, 2018 at 3:00 PM, Chamin Dias <[email protected]> wrote:

> According to this article [1] also, it agrees to send only the mandatory
> details in the response. Otherwise we may need to process over-complicated
> responses (which contains unwanted information) if we include all API,
> Application details in Subscription.
>
> [1] http://51elliot.blogspot.com/2014/06/rest-api-best-
> practices-4-collections.html
>
> On Wed, Jul 4, 2018 at 2:51 PM, Sanjeewa Malalgoda <[email protected]>
> wrote:
>
>> If we introduced both API info DTO and application info DTO as attributes
>> of subscription info DTO it would be bulky(publisher API info DTO will have
>> lot of unwanted fields for this use case). If we follow rest API best
>> practices ideally we should send ids of application and API like we do
>> now.  One option is sending display name along with UUID of resource.
>>
>> Thanks,
>> sanjeewa.
>>
>> On Wed, Jul 4, 2018 at 12:37 PM Dushani Wellappili <[email protected]>
>> wrote:
>>
>>> Hi all,
>>>
>>> According to the current Store REST API of APIM 3.0, using Subscription
>>> resource[1], we can get the subscription details for a particular API.
>>>
>>> The subscription resource is as follows.
>>> *{*
>>> *applicationId : "75834e14-d445-4e98-b90a-e2b726718384",*
>>>
>>>
>>> *lifeCycleStatus : "ACTIVE",*
>>>
>>> *policy : "Bronze",*
>>>
>>> *subscriptionId : "a1439c91-78d9-49e6-bae8-7a514eb250fc"*
>>>
>>> *apiIdentifier : "82079086-fd5c-452c-80da-1d0f06dc0252"*
>>>
>>> *apiName : "TESTAPI"*
>>>
>>> *apiVersion : "1.0.0"*
>>>
>>> *}*
>>>
>>> In here, the only detail to get information about the subscribed
>>> application is the *applicationId*. For the API listing view of Store
>>> API, we need to display the application names subscribed for the particular
>>> API.
>>>
>>> To get that information with the existing implementation, we need to
>>> first do a REST API call to get all subscriptions (list of Subscription
>>> DTOs).
>>> After that, we could either do a REST API call to get application name
>>> (Application DTO) for the each Subscribed DTO or do a REST API call to get
>>> all Applications (list of Application DTOs) and iterate it to get only the
>>> application name of subscribed applications. For both cases, when the
>>> number of subscriptions and the applications get larger, the number API
>>> calls we would need will also become larger which could result in a
>>> performance issue.
>>>
>>> The same issue is handled in Publisher REST API by including Application
>>> and API object in the SubscriptionDAO with required fields populated.
>>> Please refer the mail thread [2].
>>>
>>> Similarly, we can remove the applicationId and API related properties
>>> from SubscriptionDTO in Store REST API and include the ApplicationInfoDTO
>>> and ApiInfoDTO object as well. WDYT?
>>>
>>> Would appreciate your comments and thoughts on this.
>>>
>>>
>>> [1] https://github.com/wso2/carbon-apimgt/blob/master/compon
>>> ents/apimgt/org.wso2.carbon.apimgt.rest.api.store/src/
>>> main/resources/store-api.yaml#L3668
>>> [2] [Dev] [APIM_REST_API] What are the properties to include in DTO
>>>
>>>
>>> Regards,
>>> *Dushani Wellappili*
>>> Software Engineer - WSO2
>>>
>>> Email : [email protected]
>>> Mobile : +94779367571
>>> Web : https://wso2.com/
>>>
>>>
>>>
>>
>> --
>> *Sanjeewa Malalgoda*
>> WSO2 Inc.
>> Mobile : +94 712933253
>>
>> <http://sanjeewamalalgoda.blogspot.com/>blog
>> :http://sanjeewamalalgoda.blogspot.com/
>> <http://sanjeewamalalgoda.blogspot.com/>
>>
>>
>>
>> _______________________________________________
>> Architecture mailing list
>> [email protected]
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
> Chamin Dias
> Mobile : 0716097455
> Email : [email protected]
> LinkedIn : https://www.linkedin.com/in/chamindias
>
>
> _______________________________________________
> Architecture mailing list
> [email protected]
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>


-- 
Malintha Amarasinghe
*WSO2, Inc. - lean | enterprise | middleware*
http://wso2.com/

Mobile : +94 712383306
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to