Skip to content
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

chore: refactor api docs #628

Merged
merged 47 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
1b7f79a
chore: refactor api docs
darrenvechain Dec 19, 2023
18cf374
chore: remove a test change
darrenvechain Dec 19, 2023
cd7847e
chore: remove a test change
darrenvechain Dec 19, 2023
517acb8
chore: update docs to show nullable/optional fields
darrenvechain Dec 19, 2023
a185c71
chore: minor updates for naming
darrenvechain Dec 19, 2023
8b921b4
chore: revert tag change
darrenvechain Dec 19, 2023
ba1e87f
remove code cove and fix thor url
darrenvechain Dec 20, 2023
97559cd
remove .DS_store
darrenvechain Dec 20, 2023
3e2b58d
remove .DS_store
darrenvechain Dec 20, 2023
b3123be
remove test.cov
darrenvechain Dec 20, 2023
aebb01a
remove .DS_store
darrenvechain Dec 20, 2023
fed482c
updates for PR comments
darrenvechain Dec 26, 2023
125ca26
update API docs image
darrenvechain Dec 26, 2023
4533c46
Merge branch 'master' into api-doc-refactor
libotony Dec 27, 2023
9f079be
updates for PR comments
darrenvechain Dec 29, 2023
e7bffee
updates for PR comments
darrenvechain Dec 29, 2023
d778384
update thor.yaml
darrenvechain Jan 2, 2024
39a5cd4
update thor.yaml
darrenvechain Jan 2, 2024
a0f7ebb
Merge branch 'master' into api-doc-refactor
darrenvechain Jan 22, 2024
6fa28dd
update required and nullable fields
darrenvechain Jan 22, 2024
fa69680
revert .gitignore
darrenvechain Jan 22, 2024
ac2d3b7
remove TODO
darrenvechain Jan 22, 2024
d8f5048
remove 'nullable' descriptions
darrenvechain Jan 22, 2024
426a6ad
fix: update thor.yaml
darrenvechain Jan 25, 2024
523f9ed
chore: update thor.yaml
darrenvechain Jan 25, 2024
63a9b32
fix allOf errors
darrenvechain Jan 25, 2024
68a34b4
chore: update thor.yaml
darrenvechain Jan 29, 2024
9f05c24
fix: thor.yaml typo
darrenvechain Jan 29, 2024
2678e2a
fix: thor.yaml regex
darrenvechain Jan 29, 2024
f787647
chore: update thor.yaml
darrenvechain Jan 30, 2024
bcf4788
fix: update lint error
darrenvechain Jan 30, 2024
508b171
chore: update thor.yaml to include 'best' in query
darrenvechain Jan 31, 2024
c7be01b
Update api/doc/thor.yaml
darrenvechain Feb 2, 2024
f00ddc8
Update api/doc/thor.yaml
darrenvechain Feb 2, 2024
c0ec91f
Update api/doc/thor.yaml
darrenvechain Feb 2, 2024
e52805d
Update api/doc/thor.yaml
darrenvechain Feb 2, 2024
ea90c12
Update api/doc/thor.yaml
darrenvechain Feb 2, 2024
f1c237c
fix: yaml formatting error
darrenvechain Feb 2, 2024
4d45b62
fix: duplicate 'required'
darrenvechain Feb 2, 2024
fd71d68
feat: add swagger and install instructions
darrenvechain Feb 2, 2024
06be140
fix: schema titles
darrenvechain Feb 2, 2024
7a6fc50
chore: update block response name
darrenvechain Feb 4, 2024
8bbec79
Update api/doc/swagger-ui/window-observer.js
darrenvechain Feb 6, 2024
b450c56
Update api/doc/api-docs/window-observer.js
darrenvechain Feb 6, 2024
d00d869
chore: update PR for comments
darrenvechain Feb 6, 2024
e4c93d9
chore: update readme
darrenvechain Feb 6, 2024
36494aa
fix: remove javascript type
darrenvechain Feb 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ package.json
/node_modules/

/.vscode/
.idea
/vendor/

.fake_gopath_suffix
.fake_gopath_suffix
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ all: thor disco
clean:
-rm -rf \
$(CURDIR)/bin/thor \
$(CURDIR)/bin/disco
$(CURDIR)/bin/disco

test:| go_version_check
@go test -cover $(PACKAGES)
Expand Down
2 changes: 1 addition & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func New(
// redirect swagger-ui
router.Path("/").HandlerFunc(
func(w http.ResponseWriter, req *http.Request) {
http.Redirect(w, req, "doc/swagger-ui/", http.StatusTemporaryRedirect)
http.Redirect(w, req, "doc/api-docs/", http.StatusTemporaryRedirect)
darrenvechain marked this conversation as resolved.
Show resolved Hide resolved
})

accounts.New(repo, stater, callGasLimit, forkConfig).
Expand Down
9 changes: 8 additions & 1 deletion api/doc/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
swagger-ui from https://github.com/swagger-api/swagger-ui @v3.17.6
## Stoplight
Spotlight UI from https://github.com/stoplightio/elements
- Modified [web-components.min.js](api-docs/web-components.min.js) so that websocket endpoints do not show examples.

```diff
- t && r.createElement(li,{"data-testid":"two-column-right"....})
+ t && !window.location.href.includes("paths/subscriptions") && r.createElement(li,{"data-testid":"two-column-right"....})
```
Binary file added api/doc/api-docs/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/doc/api-docs/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added api/doc/api-docs/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions api/doc/api-docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Thor API</title>
<!-- Embed elements Elements via Web Component -->
<script src="./web-components.min.js"></script>
<link rel="stylesheet" href="./styles.min.css">
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
<link rel="icon" type="image/png" href="./favicon-96x96.png" sizes="96x96" />

</head>
<body>
<elements-api
apiDescriptionUrl="/doc/thor.yaml"
router="hash"
layout="sidebar"
logo="/doc/api-docs/favicon-96x96.png"
/>
</body>
</html>
1 change: 1 addition & 0 deletions api/doc/api-docs/styles.min.css

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions api/doc/api-docs/web-components.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api/doc/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"gopkg.in/yaml.v2"
)

//go:embed swagger-ui thor.yaml
//go:embed thor.yaml api-docs
var FS embed.FS
var version string

Expand Down
Binary file removed api/doc/swagger-ui/favicon-16x16.png
Binary file not shown.
Binary file removed api/doc/swagger-ui/favicon-32x32.png
Binary file not shown.
60 changes: 0 additions & 60 deletions api/doc/swagger-ui/index.html

This file was deleted.

67 changes: 0 additions & 67 deletions api/doc/swagger-ui/oauth2-redirect.html

This file was deleted.

93 changes: 0 additions & 93 deletions api/doc/swagger-ui/swagger-ui-bundle.js

This file was deleted.

Loading