Skip to content

Consider imported Go type lives in the same package if no mapping provided - #1

Merged
sebgl merged 1 commit into
masterfrom
no-mapping-same-pkg
Sep 7, 2021
Merged

sebgl merged 1 commit into
masterfrom
no-mapping-same-pkg

Conversation

@sebgl

@sebgl sebgl commented Sep 7, 2021

Copy link
Copy Markdown
Owner

This commit allows referencing imported types living in the same go package.
We consider no import is necessary if no import mapping is provided for the
remote reference, and reference the go type by its name (no import path).

Downside of this approach: no error is returned if the user accidentally forget
or messes up the import mapping. Code compilation will likely fail instead.

Fixes oapi-codegen#400.

…vided

This commit allows referencing imported types living in the same go package.
We consider no import is necessary if no import mapping is provided for the
remote reference, and reference the go type by its name (no import path).

Downside of this approach: no error is returned if the user accidentally forget
or messes up the import mapping. Code compilation will likely fail instead.

Fixes oapi-codegen#400.
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.

Cannot reference other specs in the same directory

1 participant