Azure / LogicAppsUX

https://learn.microsoft.com/azure/logic-apps
MIT License
74 stars 81 forks source link

All integers >= 1000000 are treated as decimals and output with ".0" #5484

Open maxmorrow-rrexpress opened 3 weeks ago

maxmorrow-rrexpress commented 3 weeks ago

Describe the Bug with repro steps

Summary

This defect occurs when attempting to map an int equal to or larger than 1000000. If the source value meets that criteria, it appears to be cast as a decimal when output to the destination schema. This issue occurs even if both source and destination types are integers.

Repro Steps

  1. Create a new data map in VS Code with a both a source and target property that is an integer
  2. Map from the source integer to the destination integer
  3. Ensure you have saved and clicked "Generate XSLT"
  4. Prepare test data that has an integer value >= 1000000
  5. Open "> Test"
  6. Paste your test data
  7. Click "Test"
  8. Observe that the integer value now has ".0" and appears to be treated as a "number" value

Example Schemas

source

{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "http://example.com/example.json",
  "type": "object",
  "default": {},
  "title": "Root Schema",
  "required": ["data"],
  "properties": {
    "data": {
      "type": "object",
      "default": {},
      "title": "The data Schema",
      "properties": {
        "Name": {
          "type": "string",
          "default": "",
          "title": "The Name Schema",
          "examples": ["Testing1"]
        },
        "LoginCount": {
          "type": "integer"
        }
      }
    }
  }
}

target

{
    "$schema": "https://json-schema.org/draft/2019-09/schema",
    "$id": "http://example.com/example.json",
    "type": "object",
    "default": {},
    "title": "Root Schema",
    "required": ["data"],
    "properties": {
      "data": {
        "type": "object",
        "default": {},
        "title": "The data Schema",
        "properties": {
          "FullName": {
            "type": "string"
          },
          "NumberOfLogins": {
            "type": "integer"
          }
        }
      }
    }
  }

Screenshots or Videos

image

image

image

image

image

image

image

Version

v4.57.6

Additional context

No response

takyyon commented 3 weeks ago

@DanielleCogs Let's add a tracking item for v2 after you are able to debug this a bit more

hartra344 commented 3 weeks ago

Would this be a front end issue or a backend issue that we should bring up to Sanjiv?

takyyon commented 3 weeks ago

Would this be a front end issue or a backend issue that we should bring up to Sanjiv?

Seems like a backend, yes, but will be good to confirm first

DanielleCogs commented 3 weeks ago

It seems to be a backend issue. I took a look, and the frontend does send over an integer to test. { "DirectTranslation": { "EmployeeID": 1000000, "EmployeeName": "John Doe" } } and we receive back a decimal value { "DirectTranslation": { "EmployeeID": 1000000. } }