lua-rapidjson icon indicating copy to clipboard operation
lua-rapidjson copied to clipboard

question: how can I get the new value with default value.

Open membphis opened this issue 6 years ago • 1 comments

local json = require('rapidjson')

local schema = {
    type = "object",
    properties = {
        key = {type = "string"},
        secret = {type = "string", default = "xxxxxxxxx"}
    }
}

local value = {key = 'zzz'}

local sd = rapidjson.SchemaDocument(schema)
local validator = rapidjson.SchemaValidator(sd)

local d = rapidjson.Document(value)

local ok, message = validator:validate(d)

I think we can get new value {key='zzz', default = "xxxxxxxxx"}, how can I get the new value.

membphis avatar Jul 24 '19 05:07 membphis

@xpol Do you have any suggestions for this question?

membphis avatar Aug 29 '19 12:08 membphis