OpenAPI: Classのプロパティに配列が含まれている場合のスキーマ定義解析結果が想定外 - #2061
Merged
Conversation
- プロパティが配列になっている場合を考慮漏れ対応 - 配列で Array, Collection 以外はありえないため、配列の場合のデッドコードを削除 - リファクタリング:スロー例外をRuntimeException -> SystemExceptionに変更 - リファクタリング:スキーマタイプ検出機能をプライベート内部クラスに抽出 - リファクタリング:return を含む if/else の else を削除 - リファクタリング:NPE発生抑止 - リファクタリング:コメントの全体統制
Contributor
There was a problem hiding this comment.
Pull request overview
OpenAPI スキーマ生成で、クラスのプロパティが配列(T[])の場合に標準型解決が行われずスキーマが想定外(例: Date[] が integer にならない)になる不具合を修正します。あわせて当該クラス・関連クラスへのリファクタリング(タイプ判定ロジックの内部クラス抽出、例外型変更、メソッド名の typo 修正、else 簡素化、コメント整理 等)を行っています。
Changes:
detector.isArray()分岐でClass#isArray()の場合をgetComponentType()経由で処理し、配列要素の標準型解決/再利用スキーマ追加を共通メソッドupdateArrayPropertySchemaに集約RuntimeExceptionをSystemExceptionに置換、配列分岐の判定ロジックをSchemaTypeDetector内部クラスへ抽出、$defsキーを定数化、getDefsSchemaの不正な$refに対する事前チェックを追加PropertyDescriptorParserのタイプミス(getPropertyDesctiptor*→getPropertyDescriptor*)を修正
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
iplass-web/.../OpenApiComponentClassReusableSchemaFactory.java |
配列プロパティの解析バグ修正、判定ロジックの内部クラス化、共通処理メソッドの抽出、例外/コメント整理 |
iplass-web/.../PropertyDescriptorParser.java |
メソッド名の typo 修正、SystemException への置換、JavaDoc 補足追加 |
yuichi-github
approved these changes
May 15, 2026
HiguchiKiyoshi
approved these changes
May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #2059
対応内容
動作確認・スクリーンショット(任意)
レビュー観点・補足情報(任意)
detector.isArray()が true の場合に、配列(Class#isArray()) のパターンを考慮していなかったことです。detector.isArray()のパターンは必ず配列になるので、Array 以外は List,Set などの Collection クラスとして判断しています。