LukasHechenberger / atom-json-editor

MIT License
22 stars 8 forks source link

Required empty string is removed #26

Open ibrot opened 4 years ago

ibrot commented 4 years ago

Hi,

I currently have the problem that I want to define a required string property with empty default value like ""

test.schema.json

{
    "definitions": {},
    "type": "object",
    "title": "Test Schema",
    "required": [
        "test"
    ],
    "properties": {
        "test": {
            "type": "string",
            "default": ""
        }
    }
}

test.json

{
    "test": ""
}

atom-json-editor now remove the property "test" and throws the error

Object missing the required property 'test'

, but I want to allow empty strings. I also tried using a regex pattern but no success. :(

Online JSON Schema validators said that this should be valid.

Am I doing something wrong or is this a problem in atom-json-editor?

Thank you and best regards :)

LukasHechenberger commented 4 years ago

It seems to be an issue in the package, thanks for reporting! I'll have a look right away.

LukasHechenberger commented 4 years ago

I wasn't able to find out where exactly this error comes from so far. I hope I'll be able to further investigate it on the weekend.

ibrot commented 4 years ago

Okay, thank you :)