cancel
Showing results for 
Search instead for 
Did you mean: 

Does the @Core.AutoExpand annotation in SAP CAP actually do something?

nicoschoenteich
Developer Advocate
Developer Advocate
0 Kudos

Hi everyone!

I have this very basic schema definition:

entity Apps : managed, cuid {
    views : Composition of many Views
                on views.app = $self @Core.AutoExpand;
};

entity Views : managed, cuid {
    app      : Association to one Apps;
};

I want to auto expand the "views" whenever I call "/Apps", meaning "/Apps" should always be treated like "/Apps?$expand=views". I found this "@Core.AutoExpand" annotation, which seems to do exactly that:

Unfortunately, it doesn't seem to work. The auto expand doesn't happen. Does this annotation actually do something? Or am I as a developer responsible to implement the feature, and the annotation is just a standardized label for this feature? But, this isn't how annotation usually work, right?

I appreciate your help!

Best, Nico

View Entire Topic
Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert

Hi nicolai.geburek,

This annotation isn't implemented on CAP NodeJS.

The OData contortion has made this annotation available via ODATA-795. Which is why you are seeing this documentation.

For more information, please read the following:

https://github.tools.sap/cap/dev/issues/896

Best regards,
Ivan

nicoschoenteich
Developer Advocate
Developer Advocate

Thank you for the answer. For some reason my research didn't lead me to those existing issues...

The link you shared is internal, which works for me, but does not for everyone. For everyone else: You didn't miss much, the feature is simply not (yet) implemented.