You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Christian Amend (JIRA)" <ji...@apache.org> on 2017/01/02 08:28:58 UTC

[jira] [Resolved] (OLINGO-1065) Multiple FunctionImports with the same name and different parameters

     [ https://issues.apache.org/jira/browse/OLINGO-1065?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Amend resolved OLINGO-1065.
-------------------------------------
    Resolution: Won't Fix
      Assignee: Christian Amend

Hi Alexander,

having multiple functions with the same name is not supported in the OData V2 protocol version. For that you have to use the OData V4 protocol.

Please use a different name for each of your function imports.

Best Regards,
Christian

> Multiple FunctionImports with the same name and different parameters
> --------------------------------------------------------------------
>
>                 Key: OLINGO-1065
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1065
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-core
>    Affects Versions: V2 2.0.7
>         Environment: SAP HCP + SAP JVM
>            Reporter: Alexander Parr
>            Assignee: Christian Amend
>            Priority: Blocker
>              Labels: FunctionImports
>
> Hi all,
> I've defined three function imports via EdmAnnotation with the same name and different parameters as there are different situations how the consumer can call this API.
> In order to express possible combinations of parameters and which can be nullable I like this approach very much. 
> The generated $metadata document looks like this:
> {code:xml}
> <FunctionImport Name="OrderCreditReport" ReturnType="core.CreditReport" EntitySet="CreditReports" m:HttpMethod="GET">
> <Parameter Name="CreditAgencyBusinessPartner" Type="Edm.String" Nullable="false" MaxLength="60"/>
> <Parameter Name="Language" Type="Edm.String" Nullable="false" MaxLength="2"/>
> <Parameter Name="GradeMethod" Type="Edm.String" Nullable="false" MaxLength="10"/>
> <Parameter Name="FscmUpdate" Type="Edm.Boolean" Nullable="true"/>
> <Parameter Name="LoadPdf" Type="Edm.Boolean" Nullable="true"/>
> </FunctionImport>
> <FunctionImport Name="OrderCreditReport" ReturnType="core.CreditReport" EntitySet="CreditReports" m:HttpMethod="GET">
> <Parameter Name="CompanyId" Type="Edm.String" Nullable="false" MaxLength="60"/>
> <Parameter Name="RequestLanguageCode" Type="Edm.String" Nullable="false" MaxLength="2"/>
> <Parameter Name="GradeMethodCode" Type="Edm.String" Nullable="false" MaxLength="10"/>
> <Parameter Name="FscmUpdate" Type="Edm.Boolean" Nullable="true"/>
> <Parameter Name="LoadPdf" Type="Edm.Boolean" Nullable="true"/>
> </FunctionImport>
> <FunctionImport Name="OrderCreditReport" ReturnType="core.CreditReport" EntitySet="CreditReports" m:HttpMethod="GET">
> <Parameter Name="CompanyId" Type="Edm.String" Nullable="false" MaxLength="60"/>
> <Parameter Name="RequestLanguageCode" Type="Edm.String" Nullable="false" MaxLength="2"/>
> <Parameter Name="CreditAgencyId" Type="Edm.Int32" Nullable="false"/>
> <Parameter Name="CreditProductId" Type="Edm.Int32" Nullable="false"/>
> <Parameter Name="FscmUpdate" Type="Edm.Boolean" Nullable="true"/>
> <Parameter Name="LoadPdf" Type="Edm.Boolean" Nullable="true"/>
> </FunctionImport>
> {code}
> Now I expect that the respective java method is invoked based on the parameters that are given by the consumer. This is not the case as I cannot call option two and three of the function import because I get error message that parameters are missing. It looks like that when there is a request only option one of the function import is validated. This is a bug from my point of view and it would be nice if it could be fixed.
> I'm using Olingo Version 2.0.7-sap-02
> Best and thanks in advance,
> Alex



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)