odata-v4-server icon indicating copy to clipboard operation
odata-v4-server copied to clipboard

Problem with circular dependecies

Open jacek-lapinski opened this issue 7 years ago • 1 comments

I want to have a model with circular dependencies. Something like this: Product { category: Category }

Category { products: Product[] }

I prepared this model using annotations and plain classes, but it generates incorrect metadata. Type of navigation property products is Collection. It should be Collection(Product).

When I used previous version of your library it started to working ok.

Incorrect metadata for: "odata-v4-mongodb": "^0.1.12", "odata-v4-server": "^0.2.10"

Correct metadata for: "odata-v4-mongodb": "^0.1.9", "odata-v4-server": "^0.1.38"

Maybe I should generate my model using different approach? Can you help me?

jacek-lapinski avatar Feb 23 '18 11:02 jacek-lapinski

Hi @jacek-lapinski, this model is working as expected: https://github.com/jaystack/odata-v4-server/blob/master/src/example/model.ts Category EntityType includes <NavigationProperty Name="Products" Type="Collection(Northwind.Product)" Partner="Category"/> How you implemented your model? How you used the decorators to annotate the OData types?

lazarv avatar May 10 '18 14:05 lazarv