Skip to content

Can't to use "id" as a string in the case that it looks like a natural number #374

@feonit

Description

@feonit

I have:

"regions": [
    {
      "id": "177",
      "name": "Moscow"
    }
]

but the request:

GET /regions/177

is empty

If i remove code from test/server/units.js:

    } else if (!isNaN(+value)) {
      return +value
    }

to:

    } else {
      return value
    }

it works fine. What is wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions