Skip to content

Comments

Bugfix: スペックにJSON系コンテンツタイプがないレスポンスで failure になるリグレッション修正#21

Merged
wadakatu merged 2 commits intomainfrom
fix/non-json-content-type-regression
Feb 21, 2026
Merged

Bugfix: スペックにJSON系コンテンツタイプがないレスポンスで failure になるリグレッション修正#21
wadakatu merged 2 commits intomainfrom
fix/non-json-content-type-regression

Conversation

@wadakatu
Copy link
Collaborator

概要

v0.6.0(PR #19)で導入された JSON 互換コンテンツタイプ対応により、スペックに JSON 系コンテンツタイプが一切ないエンドポイント(text/html のみ等)で contract test が失敗するリグレッションを修正。

変更内容

  • OpenApiResponseValidator::validate()findJsonContentType()null を返した場合、failure ではなく success(バリデーションスキップ)を返すように変更
  • 既存テスト2件(v30/v31)を *_fails*_skips_validation にリネームし、success を期待するように修正
  • text/html のみを定義するエンドポイント(/v1/logout)のリグレッション再現テストを追加
  • テストフィクスチャ petstore-3.0.json/v1/logout エンドポイントを追加
  • カバレッジ関連テストのエンドポイント数を 5 → 6 に更新

関連情報

… failing

Fixes a regression introduced in v0.6.0 (PR #19) where endpoints with
non-JSON content types (e.g. text/html) incorrectly returned a failure
result instead of skipping validation. Now returns success when no
JSON-compatible content type is found in the spec.

Fixes #20
…e skip logic

Add explanatory comments to clarify skip/mismatch behavior in the
validator and Laravel trait. Add tests for mixed JSON and non-JSON
content types (valid and invalid bodies) and an integration test
confirming non-JSON endpoints are skipped but still recorded for
coverage.
@wadakatu wadakatu merged commit 84cd399 into main Feb 21, 2026
8 checks passed
@wadakatu wadakatu deleted the fix/non-json-content-type-regression branch February 21, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: v0.6.0 regression — スペックにJSON系コンテンツタイプがないレスポンスで validation failure になる

1 participant