-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support array of / many #7
Comments
Hi @ericsolberg, awesome to hear you like it, thank you for using it! This looks like a part of the Abstract Syntax Tree (AST) that I missed on the initial implementation. I will check the compiler output and get back to you. |
Hi @ericsolberg, sorry for the delay, just wanted to let you know I just released v2.6.1 which adds support for inline array type declarations inside entities and types. Turns out it was part of the AST which I didn't consider while writing the CDS parser. Your example: entity foo {
bar1 : array of String;
bar2 : many String;
} now compiles to: export interface IFoo {
bar1: string[];
bar2: string[];
}
export enum Entity {
Foo = "foo",
}
export enum SanitizedEntity {
Foo = "Foo",
} Additionally, I wanted to add (even though it might be too late now) that it would have been possible to use something like this: type ArrayString : array of String;
type ManyString : many String;
entity foo {
bar1 : ArrayString;
bar2 : ManyString;
} which would have compiled to this: export type ArrayString = string[];
export type ManyString = string[];
export interface IFoo {
bar1: ArrayString[];
bar2: ManyString[];
}
export enum Entity {
Foo = "foo",
}
export enum SanitizedEntity {
Foo = "Foo",
} |
Is it possible to use array of for the input of the action, currently, this will return error: |
Hi @andrew-mai-laidon, I just created a new issue based on your comment. This seems like another part of the AST that has seems to have slipped through the cracks. I will take a look tomorrow. Any further communication will be in the newly created issue. |
This is an awesome tool, already very helpful to me!
I'm not sure if this is a bug (because it fails on valid CDS input) or just a feature that hasn't been implemented- I suspect the latter. But it would be nice to support array of / many constructs:
Either of these result in:
The text was updated successfully, but these errors were encountered: