Array with unspecified item specification passes validation
还没有人认领这个 Issue。
评估
调研方向
Start by locating the OpenAPI array validation entry point and compare its behavior with the specification cited in the issue. Use the supplied valid and misindented YAML examples as a regression case; done means an array without an items specification is rejected while the correctly nested version remains valid.
由索引模型根据 Issue 内容生成。
描述
An array without specified items: passes validation.
From swagger.io:
the items keyword is required in arrays
Example
(correct version)
definitions:
Pet:
required:
- id
- name
properties:
id:
type: integer
format: int64
name:
type: string
tag:
type: string
Pets:
type: object
properties:
payload:
type: array
items:
$ref: '#/definitions/Pet'
(buggy version, shares the same Pet definition)
Pets:
type: object
properties:
payload:
type: array
items:
$ref: '#/definitions/Pet'
Due to bad indentation, items is interpreted as another property of Pets and payload array is without item specification.
This schema passes through validator, but can't be used in (eg. swagger-ui).
Since the validator let's this pass, a bug like this can be very difficult to find, especially if it's part of a big code diff.
- 主要语言
- Python
- 星标
- 409
- 派生
- 73
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
python-openapi/openapi-spec-validator 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 55/100
-
难度 3/5 1-2 天 新手友好度 55/100
-
难度 3/5 1-2 天 新手友好度 30/100
-
难度 4/5 3-5 天 新手友好度 42/100
python-openapi/openapi-spec-validator#400 · 1 条评论 ·
-
kind/bug/confirmed
难度 5/5 一周以上 新手友好度 25/100
python-openapi/openapi-spec-validator#373 · 1 条评论 ·
查看 python-openapi/openapi-spec-validator 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 90/100
learningequality/ricecooker#747 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 76/100
run-llama/llama_index#23199 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
KhronosGroup/glTF-Blender-IO#2769 ·