Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

docs: Publish OpenAPI docs through GitHub pages #370

Merged
merged 1 commit into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ build/
gomocks_test.go
coverage.out
test/bdd/fixtures/keys
openAPI.yml
/test/bdd/fixtures/specs
.build/*
bin/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ open-api-spec:
@GOBIN=$(GOBIN_PATH) go install github.com/go-swagger/go-swagger/cmd/swagger@$(SWAGGER_VERSION)
@echo "Generating Open API spec"
@mkdir $(SWAGGER_DIR)
@$(GOBIN_PATH)/swagger generate spec -w ./cmd/kms-server -x github.com/trustbloc/orb -o $(SWAGGER_OUTPUT)
@$(GOBIN_PATH)/swagger generate spec -w ./cmd/kms-server -x github.com/trustbloc/orb -x github.com/trustbloc/vct -o $(SWAGGER_OUTPUT)
@echo "Validating generated spec"
@$(GOBIN_PATH)/swagger validate $(SWAGGER_OUTPUT)

Expand Down
4 changes: 2 additions & 2 deletions cmd/kms-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

// Package kms-server for key management and crypto operations.
// Package kms-server TrustBloc KMS - APIs for Key Management and Crypto operations.
//
// Schemes: http
// Version: 0.1.8
// Version: v1.0.0-rc1
// License: SPDX-License-Identifier: Apache-2.0
//
// Consumes:
Expand Down
29 changes: 29 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<html>
<head>
<!-- Load the latest Swagger UI code and style from npm using unpkg.com -->
<script src="https://unpkg.com/swagger-ui-dist@3/swagger-ui-bundle.js"></script>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@3/swagger-ui.css"/>
<title>TrustBloc KMS API</title>
</head>
<body>
<div id="swagger-ui"></div> <!-- Div to hold the UI component -->
<script>
window.onload = function () {
// Begin Swagger UI call region
const ui = SwaggerUIBundle({
url: "./openAPI.yml", //Location of Open API spec in the repo
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIBundle.SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
})
window.ui = ui
}
</script>
</body>
</html>
Loading