Skip to content

How do I use not keyword in Lua? #79

@howiezhao

Description

@howiezhao

In jsonschema we have not keyword, but how can I use it in Lua?

For example, We have jsonschema:

"dependencies": {
  "field_2": { "not": { "required": ["field_3"] } },
  "field_3": { "not": { "required": ["field_2"] } }
}

How do we represent it in Lua, I try like below but it doesn't work:

dependencies = {
    field_2 = {
        ["not"] = {
            required = {
                "field_3"
            }
        }
    },
    field_3 = {
        ["not"] = {
            required = {
                "field_2"
            }
        }
    },
}

Can someone help me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions