Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with properties that declare an element beginning with an underscore (or a property named 'enum') #92

Open
zeteref opened this issue Jan 15, 2025 · 0 comments

Comments

@zeteref
Copy link

zeteref commented Jan 15, 2025

Hi,

I was testing a jsonschema that can be simplified to:

{
    "type": "object",
    "properties": {
        "_actions": { "$ref": "#/components/schemas/Actions" }
    },
    "components": {
        "schemas": {
            "Actions": {
                "type": "object"
            }
        }
    }
}

Trying to generate validator for this schema results in:

lua: ./jsonschema/store.lua:77: attempt to index field 'base' (a nil value)
stack traceback:
        ./jsonschema/store.lua:77: in function 'resolve'
        ./jsonschema.lua:167: in function 'validator'
        ./jsonschema.lua:662: in function 'generate_validator'
        ./jsonschema.lua:173: in function 'validator'
        ./jsonschema.lua:1191: in function 'generate_main_validator_ctx'
        ./jsonschema.lua:1208: in function 'generate_validator'
        validate.lua:23: in main chunk
        [C]: in ?

which is because of this if condition here:

k:sub(1,1) ~= '_'

I cannot understand what is the purpose of this condition? I can try to fix it but i'm afraid to break something else that was supposed to be fixed by it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant