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

gnostic upgrade from yaml.v2 to yaml.v3 breaks some clients (here's the fix) #195

Open
timburks opened this issue Jul 14, 2020 · 0 comments
Assignees

Comments

@timburks
Copy link
Contributor

timburks commented Jul 14, 2020

With #194, gnostic upgrades its dependency on yaml.v2 to yaml.v3. This means that code that calls the automatically-generated NewDocument functions will break, because they take yaml.v2 data structures as input.

Affected code will get build errors for code like this:

document, err := openapi_v2.NewDocument(info, compiler.NewContext("$root", nil))

To fix this, please don't just replace yaml.v2 with yaml.v3 in client code. Instead, please use the ParseDocument functions defined in openapiv2/document.go and openapiv3/document.go. That would make the calling code look like this:

document, err := openapi_v2.ParseDocument(b)

where b is a []byte of the JSON or YAML file to be parsed.

Also, please use a tagged version of gnostic. This change will be in v0.5.0 and later.

@timburks timburks self-assigned this Jul 14, 2020
howardjohn added a commit to howardjohn/kube-openapi that referenced this issue Jan 4, 2021
Context: google/gnostic#195
Fixes kubernetes#206

Without this, it is impossible to import this library and
controller-runtime v0.7.0
howardjohn added a commit to howardjohn/kube-openapi that referenced this issue Mar 12, 2021
Context: google/gnostic#195
Fixes kubernetes#206

Without this, it is impossible to import this library and
controller-runtime v0.7.0
mattysweeps pushed a commit to mattysweeps/kube-openapi that referenced this issue May 19, 2021
Context: google/gnostic#195
Fixes kubernetes#206

Without this, it is impossible to import this library and
controller-runtime v0.7.0
mattysweeps pushed a commit to mattysweeps/kube-openapi that referenced this issue Jul 13, 2021
Context: google/gnostic#195
Fixes kubernetes#206

Without this, it is impossible to import this library and
controller-runtime v0.7.0
muvaf pushed a commit to muvaf/kube-openapi that referenced this issue Nov 8, 2021
Context: google/gnostic#195
Fixes kubernetes#206

Without this, it is impossible to import this library and
controller-runtime v0.7.0

(cherry picked from commit 9f480bc)
muvaf pushed a commit to muvaf/kube-openapi that referenced this issue Nov 8, 2021
Context: google/gnostic#195
Fixes kubernetes#206

Without this, it is impossible to import this library and
controller-runtime v0.7.0

(cherry picked from commit 9f480bc)
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

No branches or pull requests

1 participant