fix(codegen): remove upload() from image-only entities and fix Edm.Guid OData serialization#358
Open
eschavez wants to merge 1 commit into
Open
fix(codegen): remove upload() from image-only entities and fix Edm.Guid OData serialization#358eschavez wants to merge 1 commit into
eschavez wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Closes #344
Closes #357