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 <dusha...@wso2.com>
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/components/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 : dusha...@wso2.com
> 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
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to