From 398f95082b5904b8a00a476fc12358214fbc838f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Dec 2023 00:37:53 +0000 Subject: [PATCH 1/2] Bump github.com/getkin/kin-openapi from 0.120.0 to 0.122.0 in /tools Bumps [github.com/getkin/kin-openapi](https://github.com/getkin/kin-openapi) from 0.120.0 to 0.122.0. - [Release notes](https://github.com/getkin/kin-openapi/releases) - [Commits](https://github.com/getkin/kin-openapi/compare/v0.120.0...v0.122.0) --- updated-dependencies: - dependency-name: github.com/getkin/kin-openapi dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tools/go.mod | 2 +- tools/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/go.mod b/tools/go.mod index 25cef1fd110..ce710420ec3 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/alecthomas/kong v0.8.1 - github.com/getkin/kin-openapi v0.120.0 + github.com/getkin/kin-openapi v0.122.0 github.com/google/go-cmp v0.6.0 github.com/google/go-github/v57 v57.0.0 golang.org/x/sync v0.5.0 diff --git a/tools/go.sum b/tools/go.sum index 099ce0450dd..29b5dfebe54 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -6,8 +6,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/getkin/kin-openapi v0.120.0 h1:MqJcNJFrMDFNc07iwE8iFC5eT2k/NPUFDIpNeiZv8Jg= -github.com/getkin/kin-openapi v0.120.0/go.mod h1:PCWw/lfBrJY4HcdqE3jj+QFkaFK8ABoqo7PvqVhXXqw= +github.com/getkin/kin-openapi v0.122.0 h1:WB9Jbl0Hp/T79/JF9xlSW5Kl9uYdk/AWD0yAd9HOM10= +github.com/getkin/kin-openapi v0.122.0/go.mod h1:PCWw/lfBrJY4HcdqE3jj+QFkaFK8ABoqo7PvqVhXXqw= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= From 654566549db37e991ac2e5041ecc8a0679241014 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Tue, 19 Dec 2023 20:05:04 -0500 Subject: [PATCH 2/2] Fix breaking API changes from openapi3 v0.120.0 to v0.122.0 Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> --- tools/metadata/main_test.go | 35 +++++++++++++++-------------------- tools/metadata/openapi.go | 2 +- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/tools/metadata/main_test.go b/tools/metadata/main_test.go index 17de07d79a0..a00c11ba090 100644 --- a/tools/metadata/main_test.go +++ b/tools/metadata/main_test.go @@ -66,59 +66,54 @@ GET /undocumented/{undocumented_id} func TestUpdateOpenAPI(t *testing.T) { testServer := newTestServer(t, "main", map[string]interface{}{ "api.github.com/api.github.com.json": openapi3.T{ - Paths: openapi3.Paths{ - "/a/{a_id}": &openapi3.PathItem{ + Paths: openapi3.NewPaths( + openapi3.WithPath("/a/{a_id}", &openapi3.PathItem{ Get: &openapi3.Operation{ ExternalDocs: &openapi3.ExternalDocs{ URL: "https://docs.github.com/rest/reference/a", }, }, - }, - }, + })), }, "ghec/ghec.json": openapi3.T{ - Paths: openapi3.Paths{ - "/a/b/{a_id}": &openapi3.PathItem{ + Paths: openapi3.NewPaths( + openapi3.WithPath("/a/b/{a_id}", &openapi3.PathItem{ Get: &openapi3.Operation{ ExternalDocs: &openapi3.ExternalDocs{ URL: "https://docs.github.com/rest/reference/a", }, }, - }, - }, + })), }, "ghes-3.9/ghes-3.9.json": openapi3.T{ - Paths: openapi3.Paths{ - "/a/b/{a_id}": &openapi3.PathItem{ + Paths: openapi3.NewPaths( + openapi3.WithPath("/a/b/{a_id}", &openapi3.PathItem{ Get: &openapi3.Operation{ ExternalDocs: &openapi3.ExternalDocs{ URL: "https://docs.github.com/rest/reference/a", }, }, - }, - }, + })), }, "ghes-3.10/ghes-3.10.json": openapi3.T{ - Paths: openapi3.Paths{ - "/a/b/{a_id}": &openapi3.PathItem{ + Paths: openapi3.NewPaths( + openapi3.WithPath("/a/b/{a_id}", &openapi3.PathItem{ Get: &openapi3.Operation{ ExternalDocs: &openapi3.ExternalDocs{ URL: "https://docs.github.com/rest/reference/a", }, }, - }, - }, + })), }, "ghes-2.22/ghes-2.22.json": openapi3.T{ - Paths: openapi3.Paths{ - "/a/b/{a_id}": &openapi3.PathItem{ + Paths: openapi3.NewPaths( + openapi3.WithPath("/a/b/{a_id}", &openapi3.PathItem{ Get: &openapi3.Operation{ ExternalDocs: &openapi3.ExternalDocs{ URL: "https://docs.github.com/rest/reference/a", }, }, - }, - }, + })), }, }) diff --git a/tools/metadata/openapi.go b/tools/metadata/openapi.go index 0804a47020b..327b7afba87 100644 --- a/tools/metadata/openapi.go +++ b/tools/metadata/openapi.go @@ -40,7 +40,7 @@ func getOpsFromGithub(ctx context.Context, client *github.Client, gitRef string) } var ops []*operation for _, desc := range descs { - for p, pathItem := range desc.description.Paths { + for p, pathItem := range desc.description.Paths.Map() { for method, op := range pathItem.Operations() { docURL := "" if op.ExternalDocs != nil {