Skip to content

Commit

Permalink
Add Kubeapps apis docs (#2885)
Browse files Browse the repository at this point in the history
* Add protoc-gen-openapiv2 into the project

* Configure openapiv2 buf plugin

* Add very initial openapi file

* Add openapi annotations

* Add generated files

* Add generated files

* Add more docs

* Rename svc from the plugins

* Remove base_path

* Fix leftover

* Changes in go after rename in proto
  • Loading branch information
antgamdia committed May 28, 2021
1 parent 5d3ee2b commit 0b445d3
Show file tree
Hide file tree
Showing 23 changed files with 1,261 additions and 364 deletions.
3 changes: 2 additions & 1 deletion cmd/kubeapps-apis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ cli-dependencies:
go get \
github.com/spf13/cobra/cobra \
google.golang.org/grpc/cmd/protoc-gen-go-grpc \
google.golang.org/protobuf/cmd/protoc-gen-go
google.golang.org/protobuf/cmd/protoc-gen-go \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2

# Not sure if it's worth having targets for buf, but at least the targets can
# be tooling agnostic.
Expand Down
11 changes: 11 additions & 0 deletions cmd/kubeapps-apis/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,14 @@ plugins:
out: gen
opt:
- module=github.com/kubeapps/kubeapps/cmd/kubeapps-apis/gen
# Consider migrating to openapiv3 once ready
# https://github.com/grpc-ecosystem/grpc-gateway/pull/2147
- name: openapiv2
out: docs
strategy: all
opt:
- allow_merge=true
- merge_file_name=kubeapps-apis
- allow_repeated_fields_in_body=true
# - generate_unbound_methods=true # have to re-check it
# - json_names_for_fields=false # have to re-check it
13 changes: 10 additions & 3 deletions cmd/kubeapps-apis/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ deps:
owner: beta
repository: googleapis
branch: main
commit: aced890b7e944f9ca174481ad810ca5f
digest: b1-guLHfQhGOhlEA-QaPyQLoT-ZVFGJkRkluWgkzPT0ma0=
create_time: 2021-03-04T14:52:47.094456Z
commit: 2e73676eef8642dfba4ed782b7c8d6fe
digest: b1-vB11w98W2vFtEP4Veknm56Pi6DU6MpOuocESiOzvbqw=
create_time: 2021-04-26T14:55:30.644663Z
- remote: buf.build
owner: grpc-ecosystem
repository: grpc-gateway
branch: main
commit: d19475fa22444a289c46af009acce62c
digest: b1-_zhDPyr_Ctc1QRAKuad6_0xvoyPd6QaB22ldm9gzS0Q=
create_time: 2021-04-26T15:19:26.742789Z

0 comments on commit 0b445d3

Please sign in to comment.