Skip to content

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

Description

@membphis
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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions