on 10-05-2021 11:49 PM
The latest update of the CAP framework changed the behavior of 1:N navigation from an entity annotated with draft handling. Wondering if someone has experienced similar issue since latest update.
Below is a replication of the issue:
Data model: Authors to Books 1:N
entity Books {
key ID : Integer;
title : String;
stock : Integer;
author : Association to Authors;
}
entity Authors {
key ID : Integer;
name : String;
books : Association to many Books
on books.author = $self;
}
Service model: With Draft enabled, a query to expand the navigation remains empty. With Draft disabled, the navigation works. Prior to the latest update, this was working.
service CatalogService {
@readonly
entity Books as projection on my.Books;
// @odata.draft.enabled
entity Authors as projection on my.Authors;
}
The OData request to test is http://localhost:4004/catalog/Authors?$expand=books
The output expected looks like this:
{
"@odata.context": "$metadata#Authors(books())",
"value": [
{
"ID": 1,
"name": "John",
"books": [
{ "ID": 1, "title": "Wuthering Heights", "stock": 100, "author_ID": 1 },
{ "ID": 2, "title": "Jane Eyre", "stock": 500, "author_ID": 1 }
]
},
{ "ID": 2, "name": "Petra", "books": [] }
]
}
Anyone else experiencing this issue?
Should someone else experience this issue, a fix will be forthcoming in the next minor release.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
70 | |
9 | |
8 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.