Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Swagger Serving Command #812

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 .

docker-swagger:
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}'
Expand Down
18 changes: 18 additions & 0 deletions api/docs/yorkie.base.yaml
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
Loading
Loading