atom-json-editor icon indicating copy to clipboard operation
atom-json-editor copied to clipboard

Required empty string is removed

Open ibrot opened this issue 5 years ago • 3 comments

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 :)

ibrot avatar Jan 28 '20 12:01 ibrot

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

LukasHechenberger avatar Jan 28 '20 13:01 LukasHechenberger

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.

LukasHechenberger avatar Jan 29 '20 07:01 LukasHechenberger

Okay, thank you :)

ibrot avatar Jan 30 '20 11:01 ibrot