Ensure extended validators can create keywords which override exception messages

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

メンテナーはふだん 6 日以内に返信

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
backend

調査の方向性

Issue にはファイルやテストのエントリーポイントが記載されていません。まず validator と拡張 validator のドキュメントを読み、次に例外メッセージがどのように生成されるかを特定してください。拡張 validator で、それらのメッセージを上書きする schema キーワードを定義でき、例の動作をカバーするテストがある状態が完了です。

索引モデルが issue の本文から書いたものです。

説明

Dialects v2 Enhancement

Hi, first of all, thanks for all your work with this package.

All in all i think it works great and really does what it should and is supposed to do.
I think that if i should mention anything that i think could be better it would probably be better error messages, now i do understand that it is really hard to generate good error messages for all use cases but something that could be very useful is the option to add custom error messages.

Here is an example.

{
    "type": "object",
    "properties": {
        "templates": {
            "type": "object",
            "properties": {
                   "path": {"type": "string", "minLength": 1, "pattern": "^(/[^/]+)+$", "message": {"pattern": "You must use a valid full path with no trailing slashes"}}},
            "required": ["path"],
        },
    },
    "required": ["templates"],
}

I've read the documentation and haven't been able to find a way to define custom messages in the schema, but maybe i have missed something?

主要言語
Python
スター
5k
フォーク
741
平均マージ
4日 17時間
マージ済み PR(30日)
6

環境構築

はじめの一歩

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

python-jsonschema/jsonschema のほかの issue

python-jsonschema/jsonschema の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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