Skip to content

Commit

Permalink
fix(lint): Switch to json config for swagger-combine (#509)
Browse files Browse the repository at this point in the history
* Removed temporarily as it's unfinished

* fix(swagger): Switched swagger-combine config to json

* Added override

* Renamed to match spectral

* Switched to codebase-wide temporarily

* Switched namings

* Switched to warn

* Merge state
  • Loading branch information
Eengineer1 authored Jan 12, 2023
1 parent 8a088b2 commit 6207dde
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 34 deletions.
11 changes: 11 additions & 0 deletions .github/linters/.openapirc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---

##########################
##########################
## OpenAPI Linter rules ##
##########################
##########################

extends: spectral:oas
rules:
oas2-schema: warn
44 changes: 44 additions & 0 deletions api/docs/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"swagger": "2.0",
"info": {
"title": "cheqd Network - REST and gRPC Gateway Documentation",
"description": "Documentation describing REST and gRPC Gateway endpoints for cheqd network.",
"version": "v1.x",
"contact": {
"name": "Cheqd Foundation Limited",
"url": "https://cheqd.io"
},
"license": {
"name": "Apache 2.0",
"url": "https://github.com/cheqd/cheqd-node/blob/main/LICENSE"
}
},
"paths": {},
"apis": [
{
"url": "./api/docs/cheqd/did/v2/query.swagger.json"
},
{
"url": "./api/docs/cheqd/resource/v2/query.swagger.json"
}
],
"basePath": "/swagger/",
"schemes": [
"http",
"https"
],
"consumes": [
"application/json",
"application/json+ld",
"*/*"
],
"produces": [
"application/json",
"application/json+ld",
"*/*"
],
"externalDocs": {
"description": "cheqd Network Documentation",
"url": "https://docs.cheqd.io/node"
}
}
33 changes: 0 additions & 33 deletions api/docs/config.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/protoc-swagger-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cd ..
# combine swagger files
# uses nodejs package `swagger-combine`.
# all the individual swagger files need to be configured in `config.yaml` for merging
swagger-combine ${SWAGGER_DIR}/config.yaml -o ${SWAGGER_DIR}/swagger.yaml -f yaml --continueOnConflictingPaths true
swagger-combine ${SWAGGER_DIR}/config.json -o ${SWAGGER_DIR}/swagger.yaml -f yaml --continueOnConflictingPaths true

# Remove individual swagger files
rm -rf ${SWAGGER_DIR}/cheqd
Expand Down

0 comments on commit 6207dde

Please sign in to comment.