Skip to content

Commit

Permalink
fix(docs): Autogenerate Swagger docs [DEV-1839] (#57)
Browse files Browse the repository at this point in the history
* docs: Add swagger docs
* docs: Update swagger docs

* Update dependencies

* Linter fixes

* Extend Resolver functionality

* go mod tidy

* gofumpt -l -w .

* fix: Remove swagger files

* feat: Add linted swagger docs

* build: Upgrade pytest

* Update basics

* go mod tidy

* Update diddoc_service.go

* Rename splitDID

* Update base details

* Update base details

* Change base details

* Fix examples in DID APIs

* Resource-specific metadata

* Fetch specific resource

* Fetch all resource metadata

* Update all Swagger docs

* Define dereferencing examples

* Update DIDDoc metadata examples

* Update DIDDoc examples

* Update resolution_metadata.go

* Update diddoc_service.go

* Set API version

* swag fmt

* Add service examples

* Move DID Resolution annotation to ledger_service

* Update constants

* swag fmt all docs after moving

* Remove unused examples

* swag init

* Correct swag error

* PR format check

* go mod tidy

* Update doc formatting error

* Update package-lock.json

* Bump alpine version

Co-authored-by: Ankur Banerjee <ankurdotb@users.noreply.github.com>
Co-authored-by: DaevMithran <daevmithran1999@gmail.com>
  • Loading branch information
3 people committed Dec 5, 2022
1 parent 7c1d338 commit f99f4ba
Show file tree
Hide file tree
Showing 20 changed files with 1,943 additions and 80 deletions.
29 changes: 22 additions & 7 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
branches:
- main
- develop
- release/**
types:
- opened
- reopened
Expand All @@ -19,15 +20,29 @@ jobs:
lint-pr:
name: "PR format check"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
# check for the most recent release: https://github.com/CondeNast/conventional-pull-request-action/releases
# replace vX.X.X below with the most recently released version
- uses: CondeNast/conventional-pull-request-action@v0.1.2

- uses: amannn/action-semantic-pull-request@v5.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# to override config-conventional rules, specify a relative path to your rules module, actions/checkout is required for this setting!
commitlintRulesPath: "./.github/linters/.commitlint.rules.js" # default: undefined
# if the PR contains a single commit, fail if the commit message and the PR title do not match
commitTitleMatch: false # default: 'true'
# Configure which types are allowed (newline delimited).
# Default: https://github.com/commitizen/conventional-commit-types
types: |
feat
fix
build
chore
ci
docs
feat
fix
perf
refactor
revert
style
test
# Configure that a scope must always be provided.
requireScope: false
2 changes: 2 additions & 0 deletions cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
echoSwagger "github.com/swaggo/echo-swagger"
)

func getServeCmd() *cobra.Command {
Expand Down Expand Up @@ -61,6 +62,7 @@ func serve() {
requestService := services.NewRequestService(types.DID_METHOD, ledgerService)

// Routes
e.GET(types.SWAGGER_PATH, echoSwagger.WrapHandler)
e.GET(types.RESOLVER_PATH+":did", requestService.ResolveDIDDoc)
e.GET(types.RESOLVER_PATH+":did"+types.RESOURCE_PATH+":resource", requestService.DereferenceResourceData)
e.GET(types.RESOLVER_PATH+":did"+types.RESOURCE_PATH+":resource/metadata", requestService.DereferenceResourceMetadata)
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN go mod download && go build -o did-resolver main.go
### STAGE 2: Build cheqd did-resolver container image ###
#####################################################################

FROM alpine:3.16 AS resolver
FROM alpine:3.17 AS resolver

# Install pre-requisites
RUN apk update && apk add --no-cache bash ca-certificates
Expand Down
Loading

0 comments on commit f99f4ba

Please sign in to comment.