Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Validate correct use of traits

オープン
#295 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
40/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
kotlin
領域
api

調査の方向性

ファイルやテストは指定されていません。まず、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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

commercetools/rmf-codegen のほかの issue

commercetools/rmf-codegen の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。