GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Inlining of references with dot (#2109) by ewaostrowska · Pull Request #2384 · swagger-api/swagger-parser

Conversation

@ewaostrowska

@ewaostrowska ewaostrowska commented Aug 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Pull Request

Description

InlineModelResolver.flatten() generated bare schema names (e.g. admin.user) instead of fully-qualified local references (#/components/schemas/admin.user) in every $ref it produced. For simple names this was harmless, but when a model title contained a dot the bare name admin.user was parsed as a relative file reference rather than a local component reference, breaking resolution.

The array-item case for request/response bodies was previously fixed in #2330. This PR applies the same prefix to all remaining paths.

Fix

Every call-site in InlineModelResolver that sets a $ref to an extracted schema now prepends Components.COMPONENTS_SCHEMAS_REF (#/components/schemas/) instead of a bare name.

Swagger Core's $ref setter skips the auto-prefix when the name contains a ., treating it as a potential relative file path. That's correct for resolve, where admin.user could legitimately refer to ./admin.user. In flatten, every schema being referenced has just been extracted into #/components/schemas/ by the resolver, so the target is always local.

Out of scope (known issues, not introduced by this PR)

  1. Reporter of Getting invalid reference when used with flatten = true option #2109 uses example with a space admin.user schema . The spec requires component keys to match ^[a-zA-Z0-9\.\-_]+$. A space is not in that character class, so admin.user schema is not a valid component key.

  2. InlineModelResolver.java:179-180 registers am (the array) instead of inner (the item schema). - such behavior is a non-reported bug

Fixes: #2109

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • ♻️ Refactor (non-breaking change)
  • 🧪 Tests
  • 📝 Documentation
  • 🧹 Chore (build or tooling)

Checklist

  • I have added/updated tests as needed
  • I have added/updated documentation where applicable
  • The PR title is descriptive
  • The code builds and passes tests locally
  • I have linked related issues (if any)

Screenshots / Additional Context

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
djankows
djankows approved these changes Aug 24, 2026
View reviewed changes
@ewaostrowska
fix: Inlining of references with dot (#2109)
8a50dd6
@ewaostrowska
ewaostrowska force-pushed the issue-2109 branch from cb0afbe to 8a50dd6 Compare August 25, 2026 08:12
@ewaostrowska
ewaostrowska merged commit d3398c8 into master Aug 25, 2026
7 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@ewaostrowska
ewaostrowska deleted the issue-2109 branch August 25, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@djankows djankows djankows approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Getting invalid reference when used with flatten = true option

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ewaostrowska @djankows
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.