Validate correct use of traits
まだ誰も着手していません。
評価
調査の方向性
ファイルやテストは指定されていません。まず、validator を使って issue の 2 つの RAML 例を再現し、resource レベルと HTTP-method レベルでの trait の適用を比較してください。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時間
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 1週間以上 初心者へのやさしさ 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時間 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
AAswordman/Operit#1292 ·
メンテナーはふだん 3 日以内に返信
-
難易度 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 日以内に返信