generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
bugSomething isn't workingSomething isn't workingkeepaliveWill not be closed by Stale botWill not be closed by Stale botnew
Description
Is there an existing issue for this?
- I have searched the existing issues
Nature of Your Project
TypeScript
Current Behavior
When having an entity that has a key of type String @assert.range enum { ... }
entity BookIDs {
key ID : String @assert.range enum {
ID1;
ID2;
};
}
and this entity is used in an Association of another entity
entity Books {
key ID : Association to BookIDs;
title : String;
stock : Integer;
}
which in tern is used in a service
service CatalogService {
@readonly
entity Books as projection on my.Books;
}
the generated types break, as the association key of Books in the service definition uses the custom type of BookID_ID which is neither defined locally nor imported from the entity ts file.
Expected Behavior
The type is either imported or generated in file.
Steps To Reproduce
cds initcds add typescriptnpm i- Create entities as above (or see repo below)
- Look at
@cds-models/CatalogService/index.ts
Environment
- **OS**: Debian GNU/Linux 12 (bookworm)
- **Node**: v20.18.1
- **npm**: 11.1.0
- **cds-typer**: 0.33.1
- **cds**: 8.8.3Repository Containing a Minimal Reproducible Example
https://github.com/MarvinWeitz/cds-typer-service-enum-bug
Anything else?
I guess the problem will come with any specially typed key used this way, I just encountered it with enum asserted strings.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingkeepaliveWill not be closed by Stale botWill not be closed by Stale botnew