Validate correct use of traits
还没有人认领这个 Issue。
评估
调研方向
未指定文件或测试。首先使用 validator 重现 issue 中的两个 RAML 示例,并比较 trait 在 resource 级别和 HTTP-method 级别的应用;当 trait 形式像明确无效的 header 形式一样因错误而被拒绝时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
It looks like the RAML validator has issues when traits are used at the wrong place in the API spec.
When defining this trait for a HTTP method header:
traits:
right-header:
headers:
Accept:
displayName: Accept Header
type: string
description: Accept Header
required: true
pattern: ^application/json$
default: application/json
and using it at a wrong place in the API spec (the header must be on the method):
/{identifier}:
uriParameters:
identifier:
displayName: DataSource Identifier
type: string
description: The data source identifier.
is:
- right-header
get:
...
Actual behavior
The RAML validator does not complain.
When I model the same explicitly without the trait:
/{identifier}:
uriParameters:
identifier:
displayName: DataSource Identifier
type: string
description: The data source identifier.
headers:
Accept:
displayName: Accept Header
type: string
description: Accept Header
required: true
pattern: ^application/json$
default: application/json
get:
...
the RAML validator throws an error as expected.
Expected behavior
The RAML validator throws an error when using the trait at a place where its content is not compliant to the RAML standard.
- 主要语言
- Kotlin
- 星标
- 16
- 派生
- 7
- 平均合并
- 1 天 3 小时
- 30 天内合并 PR
- 3
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
commercetools/rmf-codegen 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
commercetools/rmf-codegen#333 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 45/100
commercetools/rmf-codegen#323 ·
-
难度 3/5 1-2 天 新手友好度 48/100
commercetools/rmf-codegen#313 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
commercetools/rmf-codegen#306 · 5 条评论 ·
-
难度 3/5 1-2 天 新手友好度 55/100
commercetools/rmf-codegen#293 ·
查看 commercetools/rmf-codegen 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
-
bug webview
难度 2/5 1-3 小时 新手友好度 78/100
home-assistant/android#7524 ·
维护者通常 1 天内回复
-
Issue: Bug
难度 2/5 1-3 小时 新手友好度 88/100
OpenAPITools/openapi-generator#25021 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
software-mansion/enriched-markdown#897 ·
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 68/100
detekt/detekt#9761 · 1 条评论 · 2 个 reaction ·
维护者通常 1 天内回复