Skip to content

fix: remove duplicate parameters, fix invalid patterns and examples - #127

Merged
LukasParke merged 1 commit into
mainfrom
fix/spec-lint-errors
Aug 13, 2026
Merged

LukasParke merged 1 commit into
mainfrom
fix/spec-lint-errors

Conversation

@LukasParke

@LukasParke LukasParke commented Aug 12, 2026 •

Copy link
Copy Markdown
Owner

Rebased onto the post-#117 regenerated spec. Several of the original fixes (invalid Burn enums, orphan components, missing info fields, undeclared tags) were resolved by the regeneration; this PR carries the defect classes that persist in the new spec.

What changed

  • Removed the 16 duplicate inline X-Plex-* header parameters on the three /{transcodeType}/:/transcode/universal/* operations and POST /:/timeline — the component refs on the same operations already declare them. redocly.yaml had these baselined with a note to "promote to error once fixed"; this PR does both: operation-parameters-unique is now error, so a generator regression fails CI.
  • Fixed the resolution pattern ^\d[x:]\d$ → ^\d+[x:]\d+$ (5 occurrences, videoResolution/photoResolution): the old pattern only matches single digits, so every real value like 1080x1080 failed validation.
  • Removed inline type/sort query params duplicated by the exploded mediaQuery object on /library/sections/{sectionId}/all, /autocomplete, /common, /firstCharacters (the regeneration added the /all case). Same query key was documented twice per operation; the mediaQuery versions are better typed. This duplication also makes oasdiff's parameter matching nondeterministic, which matters for the breaking-change gate in the follow-up PR.
  • Fixed the remaining invalid parameter examples: playQueueItemID (numeric example on string param), device/sort/channelsEnabled (scalar examples on array params), Policy.value (empty-string example on integer).
  • /library/file url param: non-standard format: url → format: uri.

Result

  • operation-parameters-unique: 16 → 0, now enforced at error severity
  • no-invalid-parameter-examples: 14 → 0
  • Verified locally against the full validate.yml stack: prettier clean, Redocly clean, vacuum score unchanged at the 25 baseline

Not 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-change label acknowledges.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 729eb9d1-0da5-4bad-9876-b4ba407eaabb

📥 Commits

Reviewing files that changed from the base of the PR and between 2287675 and 7fccf6e.

📒 Files selected for processing (2)
  • plex-api-spec.yaml
  • redocly.yaml
💤 Files with no reviewable changes (1)
  • plex-api-spec.yaml

📝 Walkthrough

Walkthrough

The 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.

Changes

API specification alignment

Layer / File(s) Summary
Parameter contracts and validation
plex-api-spec.yaml
Resolution patterns now accept multi-digit dimensions. The /library/file URL uses URI format. Examples use strings and YAML arrays for timeline, device, sort, and channel values. Duplicate headers, media-type parameters, obsolete schemas, and the generic 500 response are removed.
Duplicate parameter lint enforcement
redocly.yaml
The operation-parameters-unique rule is promoted from warning to error. Trailing-slash path violations remain warnings.

Estimated code review effort: 2 (Simple) | ~10 minutes

Mergeability Score: ⚪ Minimal · up to 7fccf

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

Your specification, sir, now stands precise,
With arrays and URIs properly nice.
Resolutions grow without constraint,
While duplicate parameters now meet complaint.
Redocly keeps watch, most diligently.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: removing duplicate parameters and correcting invalid patterns and examples.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/spec-lint-errors

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 win

One root cause: three transcoder endpoints duplicate shared parameters instead of referencing them. photoResolution, subtitles, and videoResolution are inlined in each of these operations rather than using $ref to the shared components at Lines 13603-13609, 13636-13651, and 13721-13727. This duplication is exactly why the multi-digit pattern and lowercase burn example fix had to be applied four times in this PR.

  • plex-api-spec.yaml#L4147-L4217: Replace the inline photoResolution, subtitles, and videoResolution definitions in makeDecision with $ref: '#/components/parameters/photoResolution', $ref: '#/components/parameters/subtitles', and $ref: '#/components/parameters/videoResolution'.
  • plex-api-spec.yaml#L4394-L4464: Apply the same $ref substitution in transcodeSubtitles.
  • plex-api-spec.yaml#L10895-L10965: Apply the same $ref substitution in startTranscodeSession.
🤖 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

📥 Commits

Reviewing files that changed from the base of the PR and between 465fd71 and 2287675.

📒 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.
@LukasParke
LukasParke force-pushed the fix/spec-lint-errors branch from b842372 to 7fccf6e Compare August 13, 2026 01:29
@LukasParke LukasParke changed the title fix: resolve all OpenAPI validation errors and invalid examples fix: remove duplicate parameters, fix invalid patterns and examples Aug 13, 2026
@LukasParke
LukasParke merged commit d2f727e into main Aug 13, 2026
7 checks passed
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.

1 participant