Skip to content

fix: resolve local types from dependency packages#2185

Open
nook4sh wants to merge 1 commit into
swaggo:masterfrom
nook4sh:fix/dependency-local-type-resolution
Open

fix: resolve local types from dependency packages#2185
nook4sh wants to merge 1 commit into
swaggo:masterfrom
nook4sh:fix/dependency-local-type-resolution

Conversation

@nook4sh

@nook4sh nook4sh commented Jul 2, 2026

Copy link
Copy Markdown

What changed

  • Preserve package path context when parsing type definitions from external dependency files.
  • Avoid panics when resolving package paths for files that were not collected through the normal search-dir path.
  • Add a minimal regression fixture where a dependency package type references another type from the same package using an unqualified identifier.

Why

When a dependency type is parsed from an external package and its fields reference sibling types without a package qualifier, swag can lose the file-to-package-path context and fail with errors such as cannot find type definition.

Tests

  • go test ./ -run 'TestPackagesDefinitions_FindTypeSpecFromExternalPackageFile|TestParseDependencyLocalTypeInNonUniquePackage' -count=1
  • go test ./...

@nook4sh nook4sh mentioned this pull request Jul 2, 2026
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