-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bundle VC-API and provide UX on API Docs #270
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c68cb2b
feat: add initial bundling of api
mprorock 2a53cae
feat: add stubs for common openapi ux
mprorock 01db86f
chore: stub in api viewers
mprorock 594fc5c
chore: update build script
mprorock 50b20ea
chore: add initial tags
mprorock 4298e47
chore: update bundling and outputs
mprorock cfe28f3
chore: specify dev dependencies
mprorock 4adeeb1
feat: add gh workflow to build and deploy docs
mprorock 19c3bff
doc: update readme for npm build
mprorock ca74e07
chore: remove any auto-gen-files
mprorock 9df6b57
chore: update gitignore for auto-gen files
mprorock File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# API Documentation for VC-API | ||
name: "Build and Publish VC-API Docs" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
prepare: | ||
name: "Prepare OAS Artifacts" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: "Build Docs" | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '16.x' | ||
- run: npm install -g redoc-cli | ||
- run: npm install -g @redocly/openapi-cli | ||
- run: npm install | ||
- run: npm run build | ||
- name: "Upload Generated Docs" | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: generated-docs | ||
path: docs | ||
|
||
deploy: | ||
name: "Deploy Docs to GitHub Pages" | ||
needs: prepare | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Download Generated Docs" | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: generated-docs | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ${{steps.download.outputs.download-path}} | ||
|
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
node_modules | ||
|
||
docs/test-suite | ||
docs/test-suite | ||
|
||
package-lock.json | ||
api/bundles/*.yml | ||
api/*.yaml |
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,16 @@ | ||
<!doctype html> | ||
<html> | ||
|
||
<head> | ||
<title>VC-API</title> | ||
<!-- needed for adaptive design --> | ||
<meta charset="utf-8"> <!-- Important: rapi-doc uses utf8 characters --> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<script type="module" src="https://unpkg.com/rapidoc/dist/rapidoc-min.js"></script> | ||
</head> | ||
|
||
<body> | ||
<rapi-doc spec-url="./vc-api.yaml" theme="dark"> </rapi-doc> | ||
</body> | ||
|
||
</html> |
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,27 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
<title>VC-API</title> | ||
<!-- needed for adaptive design --> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet"> | ||
|
||
<!-- | ||
Redoc doesn't change outer page styles | ||
--> | ||
<style> | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<redoc spec-url='./vc-api.yaml'></redoc> | ||
<script src="https://cdn.jsdelivr.net/npm/redoc@latest/bundles/redoc.standalone.js"> </script> | ||
</body> | ||
|
||
</html> |
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,30 @@ | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="description" content="SwaggerIU for VC-API" /> | ||
<title>VC-API</title> | ||
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@4.5.0/swagger-ui.css" /> | ||
</head> | ||
|
||
<body> | ||
<div id="swagger-ui"></div> | ||
<script src="https://unpkg.com/swagger-ui-dist@4.5.0/swagger-ui-bundle.js" crossorigin></script> | ||
<script src="https://unpkg.com/swagger-ui-dist@4.5.0/swagger-ui-standalone-preset.js" crossorigin></script> | ||
<script> | ||
window.onload = () => { | ||
window.ui = SwaggerUIBundle({ | ||
url: './vc-api.yaml', | ||
dom_id: '#swagger-ui', | ||
presets: [ | ||
SwaggerUIBundle.presets.apis, | ||
SwaggerUIStandalonePreset | ||
], | ||
layout: "StandaloneLayout", | ||
}); | ||
}; | ||
</script> | ||
</body> | ||
|
||
</html> |
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 @@ | ||
// noop |
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,31 @@ | ||
{ | ||
"name": "vc-api", | ||
"version": "0.0.3", | ||
"description": "Verifiable Credential API", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "openapi bundle *.yml --output ./api/bundles/ && openapi join ./api/bundles/*.yml --prefix-tags-with-filename && mv ./openapi.yaml ./api/vc-api.yaml" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/w3c-ccg/vc-api.git" | ||
}, | ||
"keywords": [ | ||
"VC", | ||
"DID", | ||
"W3C" | ||
], | ||
"author": "public-credentials@w3.org", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/w3c-ccg/vc-api/issues" | ||
}, | ||
"homepage": "https://github.com/w3c-ccg/vc-api#readme", | ||
"dependencies": { | ||
"swagger-cli": "^4.0.4" | ||
}, | ||
"devDependencies": { | ||
"@redocly/openapi-cli": "^1.0.0-beta.87", | ||
"redoc-cli": "^0.13.8" | ||
} | ||
} |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have the ability to accept this change (don't have access to @mprorock's repo). I will put this change in right after I merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented in 9b001e6.