Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG - Wrong __metadata id/uri when using a single key with Edm.Guid #666

Closed
sb-aigh opened this issue Jul 10, 2023 · 4 comments
Closed

BUG - Wrong __metadata id/uri when using a single key with Edm.Guid #666

sb-aigh opened this issue Jul 10, 2023 · 4 comments

Comments

@sb-aigh
Copy link

sb-aigh commented Jul 10, 2023

Description

Assuming one has defined a V2 entity with a single key of type Edm.Guid, like....

<EntityType Name="MyEntity">
	<Key>
		<PropertyRef Name="ID"/>
	</Key>
	<Property Name="ID" Type="Edm.Guid" Nullable="false"/>
	...
</EntityType>

The function addV2Metadata in dataAccess.ts composes an uri like /MyEntities(3cd0813b921744539da05c34d72ec7fa) which is not correct. I think, the metadata uri should have the format /MyEntities(guid'3cd0813b921744539da05c34d72ec7fa') in that case.

Expected results

The __metadata id/uri should have the correct path with ID having the right format like /MyEntities(guid'3cd0813b921744539da05c34d72ec7fa').

@sb-aigh sb-aigh changed the title Wrong __metadata id/uri when using a single key with Edm.Guid BUG - Wrong __metadata id/uri when using a single key with Edm.Guid Jul 18, 2023
@nlunets
Copy link
Member

nlunets commented Jul 25, 2023

This is fixed in version @sap-ux/ui5-middleware-fe-mockserver@2.1.114

@nlunets nlunets closed this as completed Jul 25, 2023
@sb-aigh
Copy link
Author

sb-aigh commented Jul 26, 2023

Unfortunately, the patch does not fix all scenarios. If the entity has just one key using Edm.Guid then still the returned metadata is wrong. You need to add the same logic here for branch if (Object.keys(currentKeys).length === 1) { probably?!

@nlunets nlunets reopened this Jul 27, 2023
@jonaszuberbuehler
Copy link

This doesn't only apply to Edm.Guid, the single quotes are also missing for Edm.String as an example.

@nlunets nlunets mentioned this issue Aug 1, 2023
@nlunets
Copy link
Member

nlunets commented Aug 2, 2023

Most likely fixed by [@sap-ux/ui5-middleware-fe-mockserver@2.1.115]

@nlunets nlunets closed this as completed Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants