Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

So, in typescript a number is unsigned by default? If not, your typescript representation has lost some information compared to the JSON schema example, and would theoretically allow for negative ages.

Additionally, what you've chosen is a very simple example, and even in that case you're having trouble correctly mapping the types to what is expected. What about a slightly more complex one[1]?

    {
        "$schema": "http://json-schema.org/draft-06/schema#",
        "type": "object",
        "properties": {
            "/": {}
        },
        "patternProperties": {
            "^(/[^/]+)+$": {}
        },
        "additionalProperties": false,
        "required": [ "/" ]
    }

 1: http://json-schema.org/example2.html


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: