Skip to content

docs(openapi): remove result envelope reintroduced in #31530#32088

Merged
andig merged 1 commit into
masterfrom
fix/openapi-result-envelope
Jul 23, 2026
Merged

docs(openapi): remove result envelope reintroduced in #31530#32088
andig merged 1 commit into
masterfrom
fix/openapi-result-envelope

Conversation

@andig

@andig andig commented Jul 23, 2026

Copy link
Copy Markdown
Member

As reported in #31530 (comment) by @StefanSchoof.

#31530 regenerated openapi.yaml from a base that predated #31989 and re-added the result: {...} response envelope. That envelope was removed from all HTTP handlers in #22299, and #31989 had already fixed the spec to match (fixes #31988, getLoadpointPlan example).

This re-applies the unwrap on the reusable *Result response schemas (NanoSecondsResult, NumberResult, IntegerResult, SocResult, PlanRatesResult, BooleanResult, NullResult, SuccessResult, BatteryModeResult) so the generated REST docs again show the real response shape, and regenerates mcp/openapi.json.

🤖 Generated with Claude Code

#31530 regenerated the spec from a base predating #31989 and re-added the
`result: {...}` response envelope that #31989 had removed to match the
actual handler output (the envelope was dropped from all handlers in
#22299). This unwraps the reusable *Result response schemas again and
regenerates mcp/openapi.json.

@sourcery-ai sourcery-ai 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.

Hey - I've left some high level feedback:

  • Since the envelope was reintroduced by regeneration, consider adding a guard in whatever tooling or script generates openapi.yaml/openapi.json to ensure *Result schemas remain unwrapped so this mismatch doesn’t recur.
  • It may be worth scanning for any remaining result: {...} usages in reusable schemas or path responses beyond the listed *Result types, to ensure the spec is now fully aligned with the current handlers’ response shapes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since the envelope was reintroduced by regeneration, consider adding a guard in whatever tooling or script generates `openapi.yaml`/`openapi.json` to ensure `*Result` schemas remain unwrapped so this mismatch doesn’t recur.
- It may be worth scanning for any remaining `result: {...}` usages in reusable schemas or path responses beyond the listed `*Result` types, to ensure the spec is now fully aligned with the current handlers’ response shapes.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@andig
andig merged commit ff2905a into master Jul 23, 2026
12 checks passed
@andig
andig deleted the fix/openapi-result-envelope branch July 23, 2026 13:36
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.

Oepn Api conatins result object

1 participant