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

openapi3: can't build from latest master #1036

Closed
qwerty287 opened this issue Dec 3, 2024 · 5 comments · Fixed by #1038
Closed

openapi3: can't build from latest master #1036

qwerty287 opened this issue Dec 3, 2024 · 5 comments · Fixed by #1038

Comments

@qwerty287
Copy link

Hello,

we're currently trying to update to the latest commit on master as we need a fix for #1016. However, after the update we can't use it anymore, the following error occurs:

# github.com/getkin/kin-openapi/openapi3
../../vendor/github.com/getkin/kin-openapi/openapi3/marsh.go:28:20: undefined: yaml.UnmarshalWithOrigin
cmd/server/openapi.go:24: running "go": exit status 1

Can we do something to fix it? Thanks!

For the related PR, see woodpecker-ci/woodpecker#4492.

@AriehSchneier
Copy link
Contributor

Have you tried running go mod tidy (or possibly go mod vendor)?

@qwerty287
Copy link
Author

Yes, of course

@AriehSchneier
Copy link
Contributor

Ohh, I see the problem, replace directives are not transient, you need to copy these replace directives into your go.mod.

Note for the maintainers, putting replace into a module is not a wise idea as it forces anyone that wants to use the library to add the same replace directives.

@qwerty287
Copy link
Author

Thanks for the hint, this indeed seems to be the problem. However, the underlying point seems to be that github.com/oasdiff/yaml3 and github.com/oasdiff/yaml do not declare they module names correctly (https://github.com/oasdiff/yaml3/blob/v3/go.mod#L1 and https://github.com/oasdiff/yaml/blob/main/go.mod#L1). They even reverted that: oasdiff/yaml@a96ddf1

I'm not an expert in Go dependencies, but is there a way to fix this?

@AriehSchneier
Copy link
Contributor

oasdiff/yaml3 is just a fork of invopop/yaml, we shouldn't be using the changes until they are merged in to the main project (read both answers here).

@fenollp fenollp linked a pull request Dec 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants