fix: remove duplicate parameters, fix invalid patterns and examples - #127
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe Plex API specification removes duplicate declarations and obsolete schemas and responses. It updates parameter validation and examples. Redocly now reports duplicate operation parameters as errors. ChangesAPI specification alignment
Estimated code review effort: 2 (Simple) | ~10 minutes Mergeability Score: ⚪ Minimal · up to This PR corrects OpenAPI validation errors and invalid documentation examples; no actionable merge-blocking risk remains after normal checks and review. Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
plex-api-spec.yaml (1)
4147-4217: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winOne root cause: three transcoder endpoints duplicate shared parameters instead of referencing them.
photoResolution,subtitles, andvideoResolutionare inlined in each of these operations rather than using$refto the shared components at Lines 13603-13609, 13636-13651, and 13721-13727. This duplication is exactly why the multi-digit pattern and lowercaseburnexample fix had to be applied four times in this PR.
plex-api-spec.yaml#L4147-L4217: Replace the inlinephotoResolution,subtitles, andvideoResolutiondefinitions inmakeDecisionwith$ref: '#/components/parameters/photoResolution',$ref: '#/components/parameters/subtitles', and$ref: '#/components/parameters/videoResolution'.plex-api-spec.yaml#L4394-L4464: Apply the same$refsubstitution intranscodeSubtitles.plex-api-spec.yaml#L10895-L10965: Apply the same$refsubstitution instartTranscodeSession.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plex-api-spec.yaml` around lines 4147 - 4217, Replace the inline photoResolution, subtitles, and videoResolution parameter definitions with references to the shared component parameters in makeDecision at plex-api-spec.yaml:4147-4217, transcodeSubtitles at plex-api-spec.yaml:4394-4464, and startTranscodeSession at plex-api-spec.yaml:10895-10965; use the corresponding photoResolution, subtitles, and videoResolution component symbols at each site.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@plex-api-spec.yaml`:
- Around line 4147-4217: Replace the inline photoResolution, subtitles, and
videoResolution parameter definitions with references to the shared component
parameters in makeDecision at plex-api-spec.yaml:4147-4217, transcodeSubtitles
at plex-api-spec.yaml:4394-4464, and startTranscodeSession at
plex-api-spec.yaml:10895-10965; use the corresponding photoResolution,
subtitles, and videoResolution component symbols at each site.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 3fb665da-dedd-4efd-a3aa-cc37693ad496
📒 Files selected for processing (1)
plex-api-spec.yaml
Rebuilt against the regenerated spec from #117; the same defect classes persist there: - Remove the 16 duplicate inline X-Plex-* header parameters on the three universal transcode operations and POST /:/timeline; the component $refs on the same operations already declare them - Promote operation-parameters-unique to error in redocly.yaml, per the ratchet note ('promote to error once fixed'); the generator reintroducing duplicates now fails CI - Fix resolution pattern ^\d[x:]\d$ -> ^\d+[x:]\d+$ (5 occurrences): the old pattern only matches single digits, so real values like 1080x1080 failed validation - Remove inline type/sort query params on /library/sections/{sectionId} /all, /autocomplete, /common, /firstCharacters that the exploded mediaQuery object parameter already serializes (same key documented twice; also made oasdiff parameter matching nondeterministic) - Fix remaining invalid parameter examples: playQueueItemID and device/sort/channelsEnabled array params, Policy.value type mismatch - /library/file url parameter: non-standard 'format: url' -> 'format: uri' redocly: operation-parameters-unique 16 -> 0 (now error severity), no-invalid-parameter-examples 14 -> 0. prettier and vacuum (score 25) verified locally.
b842372 to
7fccf6e
Compare
Rebased onto the post-#117 regenerated spec. Several of the original fixes (invalid
Burnenums, orphan components, missinginfofields, undeclared tags) were resolved by the regeneration; this PR carries the defect classes that persist in the new spec.What changed
X-Plex-*header parameters on the three/{transcodeType}/:/transcode/universal/*operations andPOST /:/timeline— the component refs on the same operations already declare them.redocly.yamlhad these baselined with a note to "promote to error once fixed"; this PR does both:operation-parameters-uniqueis nowerror, so a generator regression fails CI.^\d[x:]\d$→^\d+[x:]\d+$(5 occurrences,videoResolution/photoResolution): the old pattern only matches single digits, so every real value like1080x1080failed validation.type/sortquery params duplicated by the explodedmediaQueryobject on/library/sections/{sectionId}/all,/autocomplete,/common,/firstCharacters(the regeneration added the/allcase). Same query key was documented twice per operation; themediaQueryversions are better typed. This duplication also makes oasdiff's parameter matching nondeterministic, which matters for the breaking-change gate in the follow-up PR.playQueueItemID(numeric example on string param),device/sort/channelsEnabled(scalar examples on array params),Policy.value(empty-string example on integer)./library/fileurlparam: non-standardformat: url→format: uri.Result
operation-parameters-unique: 16 → 0, now enforced at error severityno-invalid-parameter-examples: 14 → 0Not addressed (pre-existing, separate effort)
The regenerated spec carries ~371 invalid examples (
no-invalid-media-type-examples: 322,no-invalid-schema-examples: 49) and 2 trailing-slash paths — these look like example-generation defects in the pipeline that produced the spec and deserve their own fix at the source.Note for reviewers
These corrections are technically "breaking" relative to the published spec (parameter removals, pattern tightening) — they fix documentation to match reality rather than changing any API. Under the gate added in the stacked PR, this is what the
breaking-changelabel acknowledges.