Skip to content

Conversation

@t-unit
Copy link
Owner

@t-unit t-unit commented Jan 16, 2026

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an AllOfNormalizer transformer that simplifies OpenAPI allOf schemas containing a single model by converting them to type aliases. This addresses common patterns (used by Spotify and others) where allOf: [$ref, {description: ...}] is used solely to add documentation to referenced schemas.

Changes:

  • Adds AllOfNormalizer class with deep transformation logic and memoization for referential consistency
  • Makes ResponseHeaderObject, ResponseBody, and RequestContent classes mutable by removing @immutable annotations, making fields non-final, and removing equality implementations
  • Adds comprehensive test coverage for the normalizer including edge cases and deep transformations

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/tonik_core/lib/src/transformer/allof_normalizer.dart New transformer implementing single-model AllOf → Alias normalization with deep traversal and memoization
packages/tonik_core/test/src/transformer/allof_normalizer_test.dart Comprehensive test suite covering normalization, edge cases, and deep transformation scenarios
packages/tonik_core/lib/tonik_core.dart Exports the new AllOfNormalizer transformer
packages/tonik_core/lib/src/model/response_header.dart Makes ResponseHeaderObject mutable to enable in-place model updates
packages/tonik_core/lib/src/model/response.dart Makes Response and ResponseBody classes mutable
packages/tonik_core/lib/src/model/request_body.dart Makes RequestContent mutable

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 40.00000% with 75 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.80%. Comparing base (e430bb8) to head (4471c73).

Files with missing lines Patch % Lines
...nik_core/lib/src/transformer/allof_normalizer.dart 38.52% 75 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #71      +/-   ##
==========================================
- Coverage   89.09%   88.80%   -0.29%     
==========================================
  Files         146      147       +1     
  Lines       11838    11925      +87     
==========================================
+ Hits        10547    10590      +43     
- Misses       1291     1335      +44     
Files with missing lines Coverage Δ
...ackages/tonik_core/lib/src/model/request_body.dart 42.85% <100.00%> (+1.78%) ⬆️
packages/tonik_core/lib/src/model/response.dart 51.85% <100.00%> (+2.67%) ⬆️
...ages/tonik_core/lib/src/model/response_header.dart 50.00% <100.00%> (+19.81%) ⬆️
...nik_core/lib/src/transformer/allof_normalizer.dart 38.52% <38.52%> (ø)
Files with missing lines Coverage Δ
...ackages/tonik_core/lib/src/model/request_body.dart 42.85% <100.00%> (+1.78%) ⬆️
packages/tonik_core/lib/src/model/response.dart 51.85% <100.00%> (+2.67%) ⬆️
...ages/tonik_core/lib/src/model/response_header.dart 50.00% <100.00%> (+19.81%) ⬆️
...nik_core/lib/src/transformer/allof_normalizer.dart 38.52% <38.52%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@t-unit t-unit merged commit b98411e into main Jan 16, 2026
3 checks passed
@t-unit t-unit deleted the normalize-composite-with-comment branch January 16, 2026 21:05
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.

3 participants