Skip to content

Apply the allow-remote-refs-from "*" default to the loader used after an overlay (2.8.x) - #2624

Merged
mromaszewicz merged 1 commit into
oapi-codegen:release/v2.8.xfrom
mromaszewicz:fix/remote-refs-overlay-default-2.8.x
Oct 23, 2026
Merged

mromaszewicz merged 1 commit into
oapi-codegen:release/v2.8.xfrom
mromaszewicz:fix/remote-refs-overlay-default-2.8.x

Conversation

@mromaszewicz

Copy link
Copy Markdown
Member

Summary

Follow-up to #2623 on release/v2.8.x, from review feedback.

On this release line an unset allow-remote-refs-from means "*", but #2623 applied that default in loadSwagger only. LoadSwaggerWithOverlay builds a second loader for the overlaid document through newLoader directly, so a library caller passing an overlay and no list got "*" for the first load and an empty policy for the second: any remote reference in the overlaid document was refused.

The CLI was not affected, because Configuration.UpdateDefaults fills the list before the loader sees it. Library callers of LoadSwaggerWithOverlay on 2.8.x that combine an overlay, remote references and a nil list were.

Change

  • The default moves into newLoader, which both loads use, so the first and second load always share the same policy.
  • The overlay test gains the missing case: nil list, overlay, remote reference, expected to be fetched on both loads. The case fails against the previous loader and passes now.

main needs no change: there nil means refuse on both loads already.

🤖 Generated with Claude Code

On the 2.8 release line an unset allow-remote-refs-from means "*", but
that default was applied in loadSwagger only. LoadSwaggerWithOverlay builds
a second loader for the overlaid document through newLoader directly, so a
library caller with an overlay and no list got "*" for the first load and
nothing for the second, and a remote reference in the overlaid document
was refused. The CLI was unaffected, since UpdateDefaults fills the list
before the loader sees it.

Move the default into newLoader, which both loads use, and cover the case
in the overlay test.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@mromaszewicz
mromaszewicz requested a review from a team as a code owner October 23, 2026 23:03
@mromaszewicz mromaszewicz added the bug Something isn't working label Oct 23, 2026
@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Moves the nil allowRemoteRefsFrom default into newLoader, so library callers get the same remote-reference policy before and after an overlay.

  • Overlay loads keep the default permission to fetch remote references.

Reviews (1) · Last reviewed commit: "Apply the "*" default to the loader used..." · Reviewed by Greptile

@mromaszewicz
mromaszewicz merged commit cedb781 into oapi-codegen:release/v2.8.x Oct 23, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant