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

Reply via email to