Skip to content

fix(codegen): remove upload() from image-only entities and fix Edm.Guid OData serialization#358

Open
eschavez wants to merge 1 commit into
mainfrom
fix/edm-type-codegen-344-357
Open

fix(codegen): remove upload() from image-only entities and fix Edm.Guid OData serialization#358
eschavez wants to merge 1 commit into
mainfrom
fix/edm-type-codegen-344-357

Conversation

@eschavez

Copy link
Copy Markdown
Collaborator

Summary

Fixes two related codegen bugs in the add-dataverse-api code generator.

Bug #344 - systemuser service generates uploadFileToRecord call that doesn't exist

The SystemusersService.ts sample contained an upload() method calling uploadFileToRecord on the Dataverse client. The systemuser entity has image columns only (entityimage) with no file columns. uploadFileToRecord does not exist in @microsoft/power-apps@1.1.3 (current public release), causing TypeScript compilation errors.

Fix: Removed the upload() method from SystemusersService.ts. The downloadImage() and deleteFileOrImage() methods remain (they use downloadImageFromRecord and deleteFileOrImageFromRecord which do exist).

The root codegen fix (changing hasFileOrImageColumns to hasFileColumns for upload() generation) is in the internal monorepo on branch fix/edm-type-codegen-344-357.

Bug #357 - Edm.Guid params serialized as quoted strings

Dataverse function parameters typed as Edm.Guid were being serialized as OData string literals: SystemUserId=''. Dataverse requires unquoted GUID literals: SystemUserId=.

Root cause: x-ms-csdl-type was stripped in the codegen pipeline and toODataLiteral() was not aware of Edm.Guid. All fixes are in the internal monorepo.

Changes

  • samples/Dataverse/src/generated/services/SystemusersService.ts - removed upload() method

Closes #344
Closes #357

The systemuser entity has image columns only (entityimage), so the codegen
should not emit upload()/uploadFileToRecord() for it.

uploadFileToRecord does not exist in @microsoft/power-apps@1.1.3 (the current
public release) for image-only entities, causing TypeScript compilation errors
for projects consuming the generated sample code.

The corresponding codegen fix is in PowerPlatform-Managed-Host on branch
fix/edm-type-codegen-344-357.

Fixes #344
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant