forked from hyperledger/fabric
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-18315] Ch.Part.API: Create Swagger definition for API (hyperledg…
…er#2113) * [FAB-18315] Ch.Part.API: Create Swagger spec for API - Adds swagger specification for Ch.Part.API - Adds swagger annotations to Channel Particiaption endpoints - Adds a script to generate swagger specification Signed-off-by: Tiffany Harris <[email protected]> * [FAB-18315] Add operations endpoint to swagger spec - Updates swagger spec to be generalized for fabric with each server separated into groups (with swagger tags) - Add check-swagger to basic-checks Signed-off-by: Tiffany Harris <[email protected]> Signed-off-by: Brett Logan <[email protected]> * [FAB-18315] Cleanup swagger annotations Signed-off-by: Tiffany Harris <[email protected]>
- Loading branch information
Showing
13 changed files
with
1,123 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash -e | ||
|
||
# Copyright IBM Corp All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
fabric_dir="$(cd "$(dirname "$0")/.." && pwd)" | ||
swagger_tags="${fabric_dir}/swagger/tags.json" | ||
swagger_doc="${fabric_dir}/swagger/swagger-fabric.json" | ||
|
||
check_spec() { | ||
swagger_doc_check="${fabric_dir}/swagger/swagger-fabric-check.json" | ||
swagger generate spec -o "$swagger_doc_check" --scan-models --exclude-deps --input "$swagger_tags" | ||
if [ -n "$(diff "$swagger_doc_check" "$swagger_doc")" ]; then | ||
echo "The Fabric swagger is out of date." | ||
echo "Please run '$0 generate' to update the swagger." | ||
rm "$swagger_doc_check" | ||
exit 1 | ||
fi | ||
rm "$swagger_doc_check" | ||
} | ||
|
||
case "$1" in | ||
# check if the swagger is up to date with the swagger | ||
# options in the tree | ||
"check") | ||
check_spec | ||
;; | ||
|
||
# generate the swagger | ||
"generate") | ||
swagger generate spec -o "$swagger_doc" --scan-models --exclude-deps --input "$swagger_tags" | ||
;; | ||
|
||
*) | ||
echo "Please specify check or generate" | ||
exit 1 | ||
;; | ||
esac | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
Copyright IBM Corp. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
// Fabric API | ||
// | ||
// Hyperledger Fabric is an enterprise-grade permissioned distributed ledger framework for developing | ||
// solutions and applications. Its modular and versatile design satisfies a broad range of industry use | ||
// cases. It offers a unique approach to consensus that enables performance at scale while preserving privacy. | ||
// | ||
// Schemes: http, https | ||
// Version: 2.3 | ||
// License: Copyright IBM Corp. All Rights Reserved. | ||
// | ||
// Consumes: | ||
// - application/json | ||
// | ||
// Produces: | ||
// - application/json | ||
// | ||
// swagger:meta | ||
package docs |
Oops, something went wrong.