Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#92 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
lua
Lĩnh vực
backend

Hướng nghiên cứu

Start with lib/jsonschema/store.lua, especially the condition near line 231 and the resolve failure at line 77. Reproduce the issue with the minimal schema shown, then trace how properties beginning with an underscore and a property named "enum" are handled; done means validator generation succeeds without regressing reference resolution.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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: https://github.com/api7/jsonschema/blob/a55072d6f4ae65a1caafea41cffd5464e971234c/lib/jsonschema/store.lua#L231

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

Ngôn ngữ chính
Lua
Star
136
Fork
29
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của api7/jsonschema

Tất cả issue của api7/jsonschema

Issue tương tự

Thêm issue về Lua

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.