Skip to content
4 changes: 2 additions & 2 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ tasks:
- |
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.8
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5.1
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v2.27.1
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.27.2
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v2.27.3
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.27.3
go install github.com/envoyproxy/protoc-gen-validate@v1.2.1
go install github.com/pressly/goose/v3/cmd/goose@v3.25.0
build:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ services:
container_name: gateway
environment:
ENV: dev
OPEN_API: swagger/auth/v1/
OPEN_API: swagger/
HTTP_PORT: 8080
AUTH_ADDRESS: auth:50051
TELEMETRY_TRACE: otel-collector:4317
Expand Down
4 changes: 2 additions & 2 deletions gateway/internal/openapi/openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ func RegisteraOpenAPIEndpoint(mux *runtime.ServeMux, dir string) error {
}
_ = openAPIdata

mux.HandlePath(http.MethodGet, "/swagger.json", func(w http.ResponseWriter, r *http.Request, pathParams map[string]string) {
mux.HandlePath(http.MethodGet, "/api.swagger.json", func(w http.ResponseWriter, r *http.Request, pathParams map[string]string) {
w.Header().Set("Content-Type", "application/json")
w.Write(openAPIdata)
w.WriteHeader(http.StatusOK)
})

swaggerHandler := httpSwagger.Handler(
httpSwagger.URL("/swagger.json"),
httpSwagger.URL("/api.swagger.json"),
)
err = mux.HandlePath(http.MethodGet, "/swagger/*", func(w http.ResponseWriter, r *http.Request, pathParams map[string]string) {
swaggerHandler(w, r)
Expand Down
2 changes: 1 addition & 1 deletion protos/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ tasks:
--go_out={{.OUT_DIR}}/go --go_opt=paths=source_relative \
--go-grpc_out={{.OUT_DIR}}/go --go-grpc_opt=paths=source_relative \
--grpc-gateway_out={{.OUT_DIR}}/go --grpc-gateway_opt=paths=source_relative \
--openapiv2_out={{.OUT_DIR}}/swagger \
--openapiv2_out=allow_merge=true,merge_file_name=api:{{.OUT_DIR}}/swagger \
${FILES}

clear:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"tags": [
{
"name": "Auth"
},
{
"name": "Profiles"
}
],
"consumes": [
Expand Down Expand Up @@ -79,9 +82,62 @@
"Auth"
]
}
},
"/v1/profiles/me": {
"get": {
"operationId": "Profiles_GetMe",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/authGetMeResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"tags": [
"Profiles"
]
}
}
},
"definitions": {
"authCreateResponse": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
},
"authGetMeResponse": {
"type": "object",
"properties": {
"porfile": {
"$ref": "#/definitions/authProfile"
}
}
},
"authProfile": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"avatar": {
"type": "string",
"format": "byte"
}
}
},
"authSignInRequest": {
"type": "object",
"properties": {
Expand Down
Loading