Skip to content

Commit

Permalink
Merge pull request #1190 from aholovko/cleanup_openapi_spec
Browse files Browse the repository at this point in the history
chore: cleanup obsolete openapi spec 2.0 and demo
  • Loading branch information
aholovko authored Mar 10, 2023
2 parents 02bf6e4 + 0e05ae6 commit 6071536
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 53 deletions.
23 changes: 1 addition & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ ifneq (,$(findstring undefined,"$(VC_REST_VERSION)"))
VC_REST_VERSION = $(subst v,,"$(TAG)$(RCPREFIX)+$(BUILD_DATE)-$(shell git rev-parse --short HEAD)")
endif

# OpenAPI spec
SWAGGER_DOCKER_IMG =quay.io/goswagger/swagger
SWAGGER_VERSION =v0.29.0
SWAGGER_DIR ="./test/bdd/fixtures/spec"
SWAGGER_OUTPUT =$(SWAGGER_DIR)"/openAPI.yml"

# Tool commands (overridable)
ALPINE_VER ?= 3.16
GO_VER ?= 1.19
Expand All @@ -46,7 +40,7 @@ endif
all: checks unit-test bdd-test

.PHONY: checks
checks: license lint open-api-spec
checks: license lint

.PHONY: generate
generate:
Expand Down Expand Up @@ -117,20 +111,6 @@ generate-test-keys: clean
--entrypoint /opt/workspace/vcs/scripts/generate_test_keys.sh \
$(OPENSSL_IMAGE)

.PHONY: open-api-spec
open-api-spec: clean
@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/vc-rest -x github.com/trustbloc/orb -o $(SWAGGER_OUTPUT)
@echo "Validating generated spec"
@$(GOBIN_PATH)/swagger validate $(SWAGGER_OUTPUT)

.PHONY: open-api-demo
open-api-demo: clean open-api-spec generate-test-keys vc-rest-docker
@echo "Running Open API demo on http://localhost:8089/openapi"
@docker-compose -f test/bdd/fixtures/docker-compose.yml up --force-recreate -d vc-openapi.trustbloc.local

.PHONY: build-wallet-cli-binaries
build-wallet-cli-binaries: clean
@mkdir -p .build/dist/bin
Expand Down Expand Up @@ -167,4 +147,3 @@ clean:
@rm -rf ./.build
@rm -rf coverage*.out
@rm -Rf ./test/bdd/docker-compose.log
@rm -rf $(SWAGGER_DIR)
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ The VCS uses golang packages from [Hyperledger Aries Framework Go]([aries-framew
To build from source see [here](docs/build.md).

## Documentation
- [VC Services](docs/vcs/README.md)
- [OpenAPI Spec](docs/vc-rest/openapi_spec.md)
- [OpenAPI Demo](docs/vc-rest/openapi_demo.md)
- [OpenAPI Spec](https://trustbloc.github.io/vcs/)

## Contributing
Thank you for your interest in contributing. Please see our [community contribution guidelines](https://github.com/trustbloc/community/blob/main/CONTRIBUTING.md) for more information.
Expand Down
15 changes: 0 additions & 15 deletions cmd/vc-rest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,6 @@ Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

// Package vc-rest VC Issuer, Verifier and Holder REST API.
//
// Terms Of Service:
//
// Schemes: http, https
// Version: 0.1.0
// License: SPDX-License-Identifier: Apache-2.0
//
// Consumes:
// - application/json
//
// Produces:
// - application/json
//
// swagger:meta
package main

import (
Expand Down
13 changes: 0 additions & 13 deletions test/bdd/fixtures/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,19 +178,6 @@ services:
networks:
- bdd_net

vc-openapi.trustbloc.local:
container_name: vc-openapi.trustbloc.local
image: swaggerapi/swagger-ui
environment:
- SWAGGER_JSON=/spec/openAPI.yml
- BASE_URL=/openapi
ports:
- "8089:8080"
volumes:
- ./spec:/spec
networks:
- bdd_net

api-gateway.trustbloc.local:
container_name: api-gateway.trustbloc.local
image: devopsfaith/krakend:${KRAKEND_IMAGE_TAG}
Expand Down

0 comments on commit 6071536

Please sign in to comment.