Hi Malintha,
Thanks for the response.
Please find my comments inline.

But I doubt we still need, sourceType. We use sourceType: FILE/INLINE for
documents because we allow people to upload PDF etc which are binary and
not editable in a text editor. But for mediation policies, it is always
text so we can even allow people to update uploaded files as well via the
inline editor.
The idea to have sourceType is to keep track of the method that the policy
is added and based on that we can decide whether to show the file in the
editor or download as a file.
As per the offline chat with Malintha, we can always show the policy
content in the inline editor regardless of it is a file upload or inline
content.
Hence there is no requirement to keep track of the source type.
Therefore +1 to remove the sourceType from the Mediation resource.

I guess we do not need the extension here? We can use the name only.
I think it make sense to have the extension as it always xml. wdyt?

Shall we use: "API Mediation Policies" (plural format as other existing
tags).
Shall we use: "Global Mediation Policies" (plural format as other existing
tags).
I used the singular format because it refers to an individual policy.

/apis/{apiId}/mediation-policies/{mediationPolicyId}/content

/mediation-policies/{mediationPolicyId}/content

And for /mediation-policies: i have used the *Global Mediation Policies*

Also
*,*

'/apis/{apiId}/mediation-policies': API Mediation Policies
/apis/{apiId}/mediation-policies/{mediationPolicyId}: API Mediation Policy

wdyt?


Thanks & Regards,
Ishara Cooray
Associate Technical Lead
Mobile : +9477 262 9512
WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware


On Fri, Aug 30, 2019 at 10:11 AM Dushan Silva <dush...@wso2.com> wrote:

> Hi ishara,
> Whats the purpose of saving the method it was received (sourceType) ?
> Correct me if i'm wrong but I feel like we do not need it as I do not see
> that value being useful.
>
> inline editor in the future to edit the mediation policies withing the 
> publisher portal.
>
> Even for this we do not need to save the sourceType right ?
>
> On Fri, Aug 30, 2019 at 9:17 AM Malintha Amarasinghe <malint...@wso2.com>
> wrote:
>
>> Few inline comments:
>>
>> On Fri, Aug 30, 2019 at 6:04 AM Ishara Cooray <isha...@wso2.com> wrote:
>>
>>> Hi,
>>> In APIM 3.0.0 Publisher rest api , we have introduced separate two APIs
>>> to retrieve mediation policy content as files. Each for API specific custom
>>> mediation policy content and for global mediation policy content.
>>>
>>> Previously, mediation policy content was in the same Mediation resource
>>> as below.
>>>
>>> #-----------------------------------------------------
>>> # The Mediation resource
>>> #-----------------------------------------------------
>>> Mediation:
>>>   title: Mediation
>>>   required:
>>>     - name
>>>     - type
>>>     - config
>>>   properties:
>>>     id:
>>>       type: string
>>>       example: 01234567-0123-0123-0123-012345678901
>>>     name:
>>>       type: string
>>>       example: json_fault.xml
>>>
>>>     type:
>>>       type: string
>>>       enum:
>>>         - in
>>>         - out
>>>         - fault
>>>       example: in
>>>     config:
>>>       type: string
>>>       example: '<sequence xmlns="http://ws.apache.org/ns/synapse"; 
>>> name="log_in_message">
>>>                     <log level="full">
>>>                         <property name="IN_MESSAGE" 
>>> value="IN_MESSAGE_21133232"/>
>>>                     </log>
>>>                 </sequence>'
>>>
>>> *In APIM 3.0.0* this is changed to,
>>> #-----------------------------------------------------
>>> # The Mediation resource
>>> #-----------------------------------------------------
>>> Mediation:
>>>   title: Mediation
>>>   required:
>>>   - name
>>>   - type
>>>   properties:
>>>     id:
>>>       type: string
>>>       example: 01234567-0123-0123-0123-012345678901
>>>     name:
>>>       type: string
>>>       example: json_fault.xml
>>>
>>> I guess we do not need the extension here? We can use the name only.
>>
>>>     type:
>>>       type: string
>>>       enum:
>>>       - in
>>>       - out
>>>       - fault
>>>       example: in
>>>     sourceType:
>>>       type: string
>>>       enum:
>>>       - FILE
>>>       - INLINE
>>>
>>> ** config property has been removed and a new property sourceType is 
>>> introduced.
>>>
>>> sourceType will decide whether the mediation policy content is received as 
>>> a file or inline content.
>>> Because we are planing to give an inline editor in the future to edit the 
>>> mediation policies withing the publisher portal.
>>>
>>> So to get a content of a mediation policy we have introduced below two rest 
>>> apis.
>>>
>>> ###################################################################
>>> # The "Individual API specific mediation sequence content" resource
>>> ###################################################################
>>> /apis/{apiId}/mediation-policies/{mediationPolicyId}/content:
>>>
>>>   #---------------------------------------------------------------
>>>   # Retrieve a particular API specific mediation sequence content
>>>   #---------------------------------------------------------------
>>>   get:
>>>     security:
>>>     - OAuth2Security:
>>>       - apim:api_view
>>>     x-examples:
>>>       $ref: docs/examples/apis/apis_id_mediationpolicies_id_content_get.yaml
>>>     summary: Downloadt an API specific mediation policy
>>>
>>> Small typo.
>>
>>>     description: |
>>>       This operation can be used to download a particular API specific 
>>> mediation policy.
>>>     parameters:
>>>     - $ref: '#/parameters/apiId'
>>>     - $ref: '#/parameters/mediationPolicyId'
>>>     - $ref: '#/parameters/If-None-Match'
>>>     tags:
>>>     - API Mediation Policy
>>>
>>> Shall we use: "API Mediation Policies" (plural format as other existing
>> tags).
>>
>>>
>>>
>>>     responses:
>>>       200:
>>>         description: |
>>>           OK.
>>>           Mediation policy returned.
>>>         headers:
>>>           Content-Type:
>>>             description: |
>>>               The content type of the body.
>>>             type: string
>>>           ETag:
>>>             description: |
>>>               Entity Tag of the response resource.
>>>               Used by caches, or in conditional requests (Will be supported 
>>> in future).
>>>             type: string
>>>           Last-Modified:
>>>             description: |
>>>               Date and time the resource has been modifed the last time.
>>>               Used by caches, or in conditional requests (Will be supported 
>>> in future).
>>>             type: string
>>>       304:
>>>         description: |
>>>           Not Modified.
>>>           Empty body because the client has already the latest version of 
>>> the requested resource (Will be supported in future).
>>>       404:
>>>         description: |
>>>           Not Found.
>>>           Requested file does not exist.
>>>         schema:
>>>           $ref: '#/definitions/Error'
>>>
>>>
>>> ###################################################################
>>> # The "Individual Global mediation policy content" resource
>>> ###################################################################
>>> /mediation-policies/{mediationPolicyId}/content:
>>>
>>>   #---------------------------------------------------------------
>>>   # Retrieve a particular Global mediation sequence content
>>>   #---------------------------------------------------------------
>>>   get:
>>>     security:
>>>     - OAuth2Security:
>>>       - apim:api_view
>>>     summary: Downloadt specific global mediation policy
>>>
>>> Small typo
>>
>>>
>>>
>>>     description: |
>>>       This operation can be used to download a particular global mediation 
>>> policy.
>>>     parameters:
>>>     - $ref: '#/parameters/mediationPolicyId'
>>>     - $ref: '#/parameters/If-None-Match'
>>>     tags:
>>>     - Global Mediation Policy
>>>
>>>
>> Shall we use: "Global Mediation Policies" (plural format as other
>> existing tags).
>>
>>
>>>
>>> Thanks & Regards,
>>>
>>> Ishara Cooray
>>> Associate Technical Lead
>>> Mobile : +9477 262 9512
>>> WSO2, Inc. | http://wso2.com/
>>> Lean . Enterprise . Middleware
>>> _______________________________________________
>>> Architecture mailing list
>>> Architecture@wso2.org
>>> 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
>> Architecture@wso2.org
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>
>
> --
> Best Regards
> Dushan Silva
> Software Engineer
>
> *WSO2, Inc. *
>
> lean . enterprise . middleware
> Mob: +94 774 979042
> _______________________________________________
> Architecture mailing list
> Architecture@wso2.org
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
_______________________________________________
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to