Unverified Commit a86e8421 authored by Fernando Takagi's avatar Fernando Takagi Committed by GitHub
Browse files

Update swagger output and angular generator (#828)

This will use the original proto names for generating the OpenAPI swagger file (no fieldname conversion to camelCase), and accordingly adjusts the angular generator.
parent 2bea84c1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -14,5 +14,5 @@

package console

//go:generate protoc -I. -I../vendor -I../vendor/github.com/heroiclabs/nakama-common -I../build/grpc-gateway-v2.3.0/third_party/googleapis -I../vendor/github.com/grpc-ecosystem/grpc-gateway/v2 --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative --grpc-gateway_out=. --grpc-gateway_opt=paths=source_relative --grpc-gateway_opt=logtostderr=true --grpc-gateway_opt=generate_unbound_methods=true --openapiv2_out=. --openapiv2_opt=logtostderr=true console.proto
//go:generate protoc -I. -I../vendor -I../vendor/github.com/heroiclabs/nakama-common -I../build/grpc-gateway-v2.3.0/third_party/googleapis -I../vendor/github.com/grpc-ecosystem/grpc-gateway/v2 --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative --grpc-gateway_out=. --grpc-gateway_opt=paths=source_relative --grpc-gateway_opt=logtostderr=true --grpc-gateway_opt=generate_unbound_methods=true --openapiv2_out=. --openapiv2_opt=json_names_for_fields=false,logtostderr=true console.proto
//go:generate sh -c "(cd openapi-gen-angular && go run . -i '../console.swagger.json' -o '../ui/src/app/console.service.ts' -rm_prefix='console,nakamaconsole,nakama,Console_')"
+1 −1
Original line number Diff line number Diff line
@@ -4340,7 +4340,7 @@ func RegisterConsoleHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeM

// RegisterConsoleHandler registers the http handlers for service Console to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterConsoleHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
func RegisterConsoleHandler(ctx context.Context, mux *runtime.ServeMux, conn grpc.ClientConnInterface) error {
	return RegisterConsoleHandlerClient(ctx, mux, NewConsoleClient(conn))
}

+151 −151

File changed.

Preview size limit exceeded, changes collapsed.

+5 −0
Original line number Diff line number Diff line
@@ -3,6 +3,11 @@ Angular service code gen

#### An utility tool to generate an angular REST client from the swagger/openapi spec service definitions generated by the protoc toolchain.


### Install
```sh
  go install github.com/heroiclabs/nakama/console/openapi-gen-angular
```
### Usage

#### Options
+3 −0
Original line number Diff line number Diff line
module github.com/heroiclabs/nakama/console/openapi-gen-angular

go 1.18
Loading