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: setting the key to a number results in an error #47

Closed
bobbyiliev opened this issue Mar 1, 2023 · 1 comment
Closed

Bug: setting the key to a number results in an error #47

bobbyiliev opened this issue Mar 1, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@bobbyiliev
Copy link
Collaborator

Describe the bug

Setting the key in a JSON schema to an int results to the following error:

TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received type number (22)

To Reproduce

Example schema to reproduce the problem:

{
    "_meta": {
        "topic": "air_quality",
        "key": "id"
    },
    "id": "datatype.number({ \"min\": 1, \"max\": 100 })",
    "timestamp": "date.recent",
    "location": {
        "latitude": "datatype.number({ \"max\": 90, \"min\": -90})",
        "longitude": "datatype.number({ \"max\": 180, \"min\": -180})"
    },
    "pm25": "datatype.float({ \"min\": 10, \"max\": 90 })",
    "pm10": "datatype.float({ \"min\": 10, \"max\": 90 })",
    "temperature": "datatype.float({ \"min\": -10, \"max\": 120 })",
    "humidity": "datatype.float({ \"min\": 0, \"max\": 100 })"
}
@bobbyiliev bobbyiliev added the bug Something isn't working label Mar 1, 2023
@chuck-alt-delete
Copy link
Contributor

closed by

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants