-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit focuses on defining the ConnectRPC API Docs as an OpenAPI Spec and includes adding a Swagger serving command. By converting the API docs to an OpenAPI Spec, it enhances the readability, consistency, and ease of use for developers utilizing the ConnectRPC API. To access swagger, run `$ make swagger` and access to localhost:3000. --------- Co-authored-by: Youngteac Hong <[email protected]>
- Loading branch information
1 parent
0987cbc
commit c86999d
Showing
6 changed files
with
5,218 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ tools: ## install tools for developing yorkie | |
go install google.golang.org/protobuf/cmd/[email protected] | ||
go install connectrpc.com/connect/cmd/[email protected] | ||
go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
go install github.com/sudorandom/[email protected] | ||
|
||
proto: ## generate proto files | ||
buf generate | ||
|
@@ -64,6 +65,16 @@ docker: ## builds docker images with the current version and latest tag | |
docker-latest: ## builds docker images with latest tag | ||
docker buildx build --push --platform linux/amd64,linux/arm64,linux/386 -t yorkieteam/yorkie:latest . | ||
|
||
swagger: ## runs swagger-ui with the yorkie api docs | ||
docker run -p 3000:8080 \ | ||
-e URLS="[ \ | ||
{ url: 'docs/yorkie/v1/admin.openapi.yaml', name: 'Admin' }, \ | ||
{ url: 'docs/yorkie/v1/resources.openapi.yaml', name: 'Resources' }, \ | ||
{ url: 'docs/yorkie/v1/yorkie.openapi.yaml', name: 'Yorkie' } \ | ||
]" \ | ||
-v `pwd`/api/docs:/usr/share/nginx/html/docs/ \ | ||
swaggerapi/swagger-ui | ||
|
||
help: | ||
@echo 'Commands:' | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " %-20s %s\n", $$1, $$2}' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: Yorkie | ||
description: "Yorkie is an open source document store for building collaborative editing applications." | ||
version: v0.4.14 | ||
servers: | ||
- url: https://api.yorkie.dev | ||
description: Production server | ||
- url: http://localhost:8080 | ||
description: Local server | ||
components: | ||
securitySchemes: | ||
ApiKeyAuth: | ||
type: apiKey | ||
in: header | ||
name: Authorization | ||
security: | ||
- ApiKeyAuth: [] # use the same name as under securitySchemes |
Oops, something went wrong.