diff --git a/plugins/grpc-ecosystem/openapiv3/source.yaml b/plugins/grpc-ecosystem/openapiv3/source.yaml new file mode 100644 index 000000000..e28f7df43 --- /dev/null +++ b/plugins/grpc-ecosystem/openapiv3/source.yaml @@ -0,0 +1,4 @@ +source: + github: + owner: grpc-ecosystem + repository: grpc-gateway diff --git a/plugins/grpc-ecosystem/openapiv3/v2.30.0/.dockerignore b/plugins/grpc-ecosystem/openapiv3/v2.30.0/.dockerignore new file mode 100644 index 000000000..5d0f124ff --- /dev/null +++ b/plugins/grpc-ecosystem/openapiv3/v2.30.0/.dockerignore @@ -0,0 +1,2 @@ +* +!Dockerfile diff --git a/plugins/grpc-ecosystem/openapiv3/v2.30.0/Dockerfile b/plugins/grpc-ecosystem/openapiv3/v2.30.0/Dockerfile new file mode 100644 index 000000000..aff8dd8aa --- /dev/null +++ b/plugins/grpc-ecosystem/openapiv3/v2.30.0/Dockerfile @@ -0,0 +1,15 @@ +# syntax=docker/dockerfile:1.24 +FROM --platform=$BUILDPLATFORM golang:1.26.6-trixie@sha256:b75d466dd608587fd66cca705a307ba65b889827d06ad61d6a75f0482b51b7c7 AS build + +ARG TARGETOS TARGETARCH +ENV CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH + +RUN --mount=type=cache,target=/go/pkg/mod \ + go install -ldflags="-s -w" -trimpath github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv3@v2.30.0 \ + && mv /go/bin/${GOOS}_${GOARCH}/protoc-gen-openapiv3 /go/bin/protoc-gen-openapiv3 || true + +FROM scratch +COPY --from=build --link --chown=root:root /etc/passwd /etc/passwd +COPY --from=build --link /go/bin/protoc-gen-openapiv3 / +USER nobody +ENTRYPOINT [ "/protoc-gen-openapiv3" ] diff --git a/plugins/grpc-ecosystem/openapiv3/v2.30.0/buf.plugin.yaml b/plugins/grpc-ecosystem/openapiv3/v2.30.0/buf.plugin.yaml new file mode 100644 index 000000000..0f8eeda55 --- /dev/null +++ b/plugins/grpc-ecosystem/openapiv3/v2.30.0/buf.plugin.yaml @@ -0,0 +1,7 @@ +version: v1 +name: buf.build/grpc-ecosystem/openapiv3 +plugin_version: v2.30.0 +source_url: https://github.com/grpc-ecosystem/grpc-gateway +description: Generates OpenAPI v3 definitions for Protobuf services. +spdx_license_id: BSD-3-Clause +license_url: https://github.com/grpc-ecosystem/grpc-gateway/blob/v2.30.0/LICENSE diff --git a/tests/plugins_test.go b/tests/plugins_test.go index 9599db08a..cbf6a0fc9 100644 --- a/tests/plugins_test.go +++ b/tests/plugins_test.go @@ -89,6 +89,7 @@ exec docker run --log-driver=none --rm -i {{.ImageName}}:{{.Version}} "$@" allowedEmptyPluginSums = map[string]map[string]bool{ "buf.build/bufbuild/validate-java": {"eliza": true, "petapis": true}, "buf.build/grpc-ecosystem/gateway": {"eliza": true, "petapis": true}, + "buf.build/grpc-ecosystem/openapiv3": {"eliza": true, "petapis": true}, "buf.build/community/mercari-grpc-federation": {"eliza": true, "petapis": true}, "buf.build/googlecloudplatform/bq-schema": {"eliza": true, "petapis": true}, } @@ -154,6 +155,8 @@ func TestGeneration(t *testing.T) { if semver.Compare(toTest.PluginVersion, "v2.16.0") >= 0 { testPluginWithImage(t, toTest, "grpc-gateway") } + case "grpc-ecosystem/openapiv3": + testPluginWithImage(t, toTest, "grpc-gateway") case "community/mercari-grpc-federation": switch { case semver.Compare(toTest.PluginVersion, "v1.4.1") >= 0: diff --git a/tests/testdata/buf.build/grpc-ecosystem/openapiv3/v2.30.0/eliza/plugin.sum b/tests/testdata/buf.build/grpc-ecosystem/openapiv3/v2.30.0/eliza/plugin.sum new file mode 100644 index 000000000..7d9c0f31d --- /dev/null +++ b/tests/testdata/buf.build/grpc-ecosystem/openapiv3/v2.30.0/eliza/plugin.sum @@ -0,0 +1 @@ +h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= diff --git a/tests/testdata/buf.build/grpc-ecosystem/openapiv3/v2.30.0/grpc-gateway/plugin.sum b/tests/testdata/buf.build/grpc-ecosystem/openapiv3/v2.30.0/grpc-gateway/plugin.sum new file mode 100644 index 000000000..fa6459519 --- /dev/null +++ b/tests/testdata/buf.build/grpc-ecosystem/openapiv3/v2.30.0/grpc-gateway/plugin.sum @@ -0,0 +1 @@ +h1:sDv/LdN7stRRvSCZnvvCnl7pXGppD04NgjjsDGgKboY= diff --git a/tests/testdata/buf.build/grpc-ecosystem/openapiv3/v2.30.0/petapis/plugin.sum b/tests/testdata/buf.build/grpc-ecosystem/openapiv3/v2.30.0/petapis/plugin.sum new file mode 100644 index 000000000..7d9c0f31d --- /dev/null +++ b/tests/testdata/buf.build/grpc-ecosystem/openapiv3/v2.30.0/petapis/plugin.sum @@ -0,0 +1 @@ +h1:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=