cds-typer icon indicating copy to clipboard operation
cds-typer copied to clipboard

[BUG] String enum in composition of many potentially not supported

Open tsteckenborn opened this issue 1 year ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Nature of Your Project

TypeScript

Current Behavior

Given cds such as:

entity Something : cuid {
  taggedElements : Composition of many {
                                  hierarchyLevel : String enum {
                                    oneTaggedElementHierarchyLevel
                                  };
                              key elementGuid           : String;
                            };

The following type is generated:

export function _SomethingAspect<TBase extends new (...args: any[]) => object>(Base: TBase) {
  return class Something extends Base {
        taggedElements?: __.Composition.of.many<Array< {
  hierarchyLevel?: taggedElements_hierarchyLevel | null,
  elementGuid?: string,
}>>;
  };
}

Yet taggedElements_hierarchyLevel is not defined.

Expected Behavior

I would've expected taggedElements_hierarchyLevel to exist.

Steps To Reproduce

No response

Environment

- **OS**: Mac OS
- **Node**: v20.10.0
- **npm**: 10.2.3
- **cds-typer**: 0.12.0
- **cds**: 7.4.1

Repository Containing a Minimal Reproducible Example

No response

Anything else?

No response

tsteckenborn avatar Nov 27 '23 18:11 tsteckenborn