Provide a helper to fully resolve $refs in a schema
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- json, python
- Lĩnh vực
- api, backend-api-design
Hướng nghiên cứu
Bắt đầu bằng cách xem xét API hiện có của repository được tham chiếu và schema mẫu trong issue này. Một kết quả hoàn chỉnh sẽ cung cấp cách duyệt qua schema với các $refs nội bộ được inline, đồng thời tránh việc mở rộng vô hạn do các tham chiếu đến chính nó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I want to generate some documentation/description (probably some input forms) from a json schema that contains $refs. Is there a way in jsonschema to retrieve a json schema with $refs resolved and inlined, so I can iterate through the schema?
So from a schema like this:
{
"definitions": {
"some_object": {
"type": "object",
"title": "My definition",
"description": "Some description",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "number"
}
}
}
},
"properties": {
"list_of_objects": {
"type": "array",
"title": "Some stuff",
"description": "List of stuff",
"items": {"$ref": "#/definitions/some_object"}
}
}
}
I want to have this structure in my Python object (notice that the {$ref:...} section is replaced by the actual definition):
{
"definitions": {
"some_object": {
"type": "object",
"title": "My definition",
"description": "Some description",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "number"
}
}
}
},
"properties": {
"list_of_objects": {
"type": "array",
"title": "Some stuff",
"description": "List of stuff",
"items": {
"type": "object",
"title": "My definition",
"description": "Some description",
"properties": {
"name": {
"type": "string"
},
"value": {
"type": "number"
}
}
}
}
}
}
I am aware that with self-referencing schemas this will lead to an infinite structure, but hopefully this is feasible with reasonable limitations (eg. excluding self-refs).
- Ngôn ngữ chính
- Python
- Star
- 53
- Fork
- 27
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 8
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của python-jsonschema/referencing
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
python-jsonschema/referencing#366 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
python-jsonschema/referencing#257 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
python-jsonschema/referencing#226 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
python-jsonschema/referencing#178 · 6 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
python-jsonschema/referencing#160 · 3 bình luận · 2 reaction ·
Tất cả issue của python-jsonschema/referencing
Issue tương tự
-
essnmx good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
-
[Feature] 奇物选择添加优先级 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
syfoud/Simulated_Scepter#174 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Giskard-AI/giskard-oss#2840 · 1 bình luận ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Đang mởarea: repo bug perceived difficulty: 2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
yeti-platform/yeti#1380 ·