[ 
https://issues.apache.org/jira/browse/OLINGO-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16413307#comment-16413307
 ] 

Roger Che commented on OLINGO-1252:
-----------------------------------

[~rareddy]

Hi Ramesh, 

I have checked the OData4 spec on 
[http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part3-csdl.html.] In 
3.3 Element edmx:Reference, there is 

_Note: referencing documents is not recursive. Only named elements defined in 
directly referenced documents can be used within the schema. However, those 
elements may in turn include elements defined in schemas referenced by their 
defining schema._

 

I think this is what you mentioned. 

But I still think there is issue in the code implementation. Let's still use 
the test case as an example. The test created some mock schema files that 
import one another. The test.xml references a.xml and a.xm references b.xml. 
And MetadataParser will parse them to create EdmProvider(s). 

I agree that the the EdmProvider of test.xml should have reference of models in 
a.xml, and should not have reference of models in b.xml. This is in line with 
the note i quoted above.

I would argue that the EdmProvider of the a.xml should have reference to the 
models in b.xml. 

If i keep the test case unchanged, i mean 
parser.recursivelyLoadReferences(false); 

!image-2018-03-26-10-55-57-818.png!

line 1 is the provider of test.xml. It has a reference of the provider of a.xml 
in line 2 and there is no reference to b.xml. But i expect the provider of 
a.xml (line2) should have its reference to models in b.xml which should be at 
line 3. 

Hope i describe the issue clearly. Thanks

 

> MetaDataParser will stack overflow when parsing circle references recursively 
> ------------------------------------------------------------------------------
>
>                 Key: OLINGO-1252
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1252
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata4-server
>    Affects Versions: (Java) V4 4.4.0
>            Reporter: Roger Che
>            Priority: Blocker
>         Attachments: image-2018-03-26-10-55-57-818.png
>
>
> It is a follow up of https://issues.apache.org/jira/browse/OLINGO-861. The 
> fix introduce the recursively resolving of SchemaBasedEdmProvider. But it 
> will have stack overflow when schema are referencing in circle.
> It is easy to reproduce, just update the test case 
> org.apache.olingo.server.core.MetadataParserTest#testReferenceLoad
> and change 
> parser.recursivelyLoadReferences(false);
> to 
> parser.recursivelyLoadReferences(true);
> and run it.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to