問題タブ [springdoc]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
3652 参照

springdoc - springdoc のデフォルトの応答クラス

一部のエラー コードについて、API のすべてのエンドポイントにデフォルトのエラー モデルを追加しようとしています。

次の問題を読んで、部分的な解決策を見つけました。

これは、そのカスタマイズ用に作成している Bean です。

そして、私の Error クラスは次のようになります。

問題は、swagger-ui でエンドポイント定義の 1 つを開くと、次のエラーが発生することです。

Could not resolve reference: Could not resolve pointer: /components/schemas/ErrorItem does not exist in document

ErrorItem のスキーマを定義して、swagger-ui で使用できるようにするにはどうすればよいですか?

私は使っている:

  • スプリング ブート => 2.2.4.Release
  • springdoc-openapi-ui => 1.3.0
  • springdoc-openapi-security => 1.3.0