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 - @sap-ux/ui5-middleware-fe-mockserver not managing dates as entity key #864

Open
1 of 3 tasks
archetypon opened this issue Sep 27, 2024 · 3 comments
Open
1 of 3 tasks

Comments

@archetypon
Copy link

Description

@sap-ux/ui5-middleware-fe-mockserver is not actually managing datetime as entity key.
I have an entity like as follow:

<EntityType Name="MyEntity">
        <Key>
          <PropertyRef Name="stringKey1"/>
          <PropertyRef Name="stringKey2"/>
          <PropertyRef Name="dateTimeKey"/>
        </Key>
        <Property Name="stringKey1" Type="Edm.String" Nullable="false"/>
        <Property Name="stringKey2" Type="Edm.String" MaxLength="10" Nullable="false"/>
        <Property Name="dateTimeKey" Type="Edm.DateTime" Nullable="false" sap:display-format="Date"/>
</EntityType>

When trying to retrieve a single entity with proper key as for example
/MyEntity(stringKey1='something',stringKey2='somethingagain',dateTimeKey=datetime'2024-01-01T00%3A00%3A00')
the mock server returns a 404 http code response.
The server expect to treat the attribute as a string (so for instance '/Date(1234567890)/').

Steps to Reproduce

Steps to reproduce the behavior:

  1. Run a UI5 application with mock server
  2. Request an entity with Edm.DateTime type as key attribute

Expected results

It should let use it as key

Actual results

Is returning a 404

Version/Components/Environment

Add any other context about the problem here
OS:

  • Mac OS
  • Windows
  • Other

Root Cause Analysis

Problem

{describe the problem}

Fix

{describe the fix}

Why was it missed

{Some explanation why this issue might have been missed during normal development/testing cycle}

How can we avoid this

{if we don’t want to see this type of issues anymore what we should do to prevent}

@helencorrigan
Copy link

FYI @nlunets

@AdrianDengusiak
Copy link

We have found similar issue, but with filtering.

OData Service V2
Property:
<Property Name="DeliveryDate" Type="Edm.DateTime" Nullable="false" sap:label="Delivery Date" sap:creatable="false" sap:updatable="false" sap:display-format="Date"/>

When using Smart Table with Smart Filter Bar, we get empty response. Fails with both own mock data, but also generated one.

@nlunets
Copy link
Member

nlunets commented Nov 12, 2024

Could you provide the request and expected response from both case ?
I have a potential fix but i want to be sure not to miss some case :)

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

4 participants