Improve error messages from error handlers

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
aws, flask, python
領域
api, backend

調査の方向性

Read discussion 757 and trace BaseAPICallValidator._find_path into BasePathFinder.find and APICallPathFinder._get_servers_iter in openapi_core/validation/validators.py and openapi_core/templating/paths/finders.py. Use the ServerNotFound exception in openapi_core/templating/paths/exceptions.py as the starting point; done means the error-handler messages clearly explain the validation failure and its meaning.

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

説明

area/contrib
Discussed in https://github.com/python-openapi/openapi-core/discussions/757

Originally posted by jtherrmann January 11, 2024
All of the API endpoints for the test deployment of our Flask app, which is deployed via Amazon API Gateway, are currently returning a response like the one below:

{
  "detail": "Server not found for https://vd2gh6uqw3.execute-api.us-west-2.amazonaws.com/api/user",
  "status": 400,
  "title": "Bad Request",
  "type": "about:blank"
}

We depend on the latest pre-release of openapi-core, https://github.com/python-openapi/openapi-core/releases/tag/0.19.0a1.

The error message leads me to believe that openapi-core is raising a ServerNotFound exception from BasePathFinder.find (here), which is called from BaseAPICallValidator._find_path (here).

I have a couple of questions:

  • Is BaseAPICallValidator for validating requests, responses, or both?
  • Why does the validator need to validate the server URL? What exactly does APICallPathFinder._get_servers_iter do? What is the fundamental meaning of a ServerNotFound exception?
主要言語
Python
スター
368
フォーク
140
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

python-openapi/openapi-core のほかの issue

python-openapi/openapi-core の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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