dataverse-gen icon indicating copy to clipboard operation
dataverse-gen copied to clipboard

Inconsistency in object names

Open BenediktBergmann opened this issue 3 years ago • 2 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.

BenediktBergmann avatar Aug 22 '22 06:08 BenediktBergmann

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.

scottdurow avatar Aug 22 '22 18:08 scottdurow

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.

BenediktBergmann avatar Aug 22 '22 18:08 BenediktBergmann