scottdurow / dataverse-gen

Early-bound types generator for CDS/Dataverse

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inconsistency in object names

BenediktBergmann opened this issue · comments

When dataverse-gen runs and creates the typings for a table there are 3 objects created in the entities ts file (Metadata, Attributes and the entity itself).
There is an inconsistency in this naming. The Metadata object is in camalCase where as the other two are in PascalCase.
If you for example generate the typings for Account you will get the following objects/definitions:

  • accountMetadata
  • AccountAttributes
  • Account

I think they should be named the same way.

Thanks for this @BenediktBergmann - this is a topic that I've wrestled with myself whilst writing dataverse-ify. The problem is of course that Dataverse uses Pascale Case for the SchemaNames - whilst it's standard practice to use camcelCase in TypeScript. I agree consistency should be a priority.
For backward compact - perhaps a flag is needed to control this otherwise it'll break any existing imports after re-generating the metadata.

I do agree. This is maybe a case where naming standards of C# (Back-End) and TS/JS (Front-End) do colide.

I think a flag to make it backward compatible sounds great.