Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break cyclic dependencies by moving runtime.File #143

Closed
kzys opened this issue Jan 14, 2022 · 0 comments · Fixed by go-openapi/runtime#233
Closed

Break cyclic dependencies by moving runtime.File #143

kzys opened this issue Jan 14, 2022 · 0 comments · Fixed by go-openapi/runtime#233

Comments

@kzys
Copy link
Contributor

kzys commented Jan 14, 2022

Currently validate depends runtime but runtime depends validate. Luckily validate only uses runtime.File.

So, how about moving runtime.File to validate, swag or somewhere else? We could keep runtime.File as an alias.

kzys added a commit to kzys/swag that referenced this issue Jan 28, 2022
The File type is defined in go-openapi/runtime and used from
go-openapi/validate. However the runtime package uses the validate
package which makes a circular dependency between them.

go-openapi/validate#143

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
kzys added a commit to kzys/swag that referenced this issue Jan 29, 2022
The File type is defined in go-openapi/runtime and used from
go-openapi/validate. However the runtime package uses the validate
package which makes a circular dependency between them.

go-openapi/validate#143

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
kzys added a commit to kzys/validate that referenced this issue Feb 1, 2022
While runtime.File will be defined as an alias, that won't be seen in
the run-time, so reflection need to use swag.File instead.

go-openapi#143

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
kzys added a commit to kzys/runtime that referenced this issue Feb 3, 2022
Fixes go-openapi/validate#143.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
kzys added a commit to kzys/runtime that referenced this issue Feb 3, 2022
This change breaks dependency cycles by

- Updating go-openapi/* packages to remove go-openapi/runtime from them.
  Previously some of them were consuming runtime while runtime uses them.
- Use swag.File as runtime.File to make the type compatible with
  go-openapi/validate that now uses swag.File.

This fixes go-openapi/validate#143.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
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 a pull request may close this issue.

1 participant