Skip to content

Commit 8645558

Browse files
committed
init
0 parents  commit 8645558

65 files changed

Lines changed: 13761 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:react/recommended"
10+
],
11+
"overrides": [
12+
{
13+
"env": {
14+
"node": true
15+
},
16+
"files": [".eslintrc.{js,cjs}"],
17+
"parserOptions": {
18+
"sourceType": "script"
19+
}
20+
}
21+
],
22+
"parser": "@typescript-eslint/parser",
23+
"parserOptions": {
24+
"ecmaVersion": "latest",
25+
"sourceType": "module"
26+
},
27+
"plugins": ["@typescript-eslint", "react"],
28+
"rules": {
29+
"react/react-in-jsx-scope": "off"
30+
},
31+
"settings": {
32+
"react": {
33+
"version": "detect"
34+
}
35+
}
36+
}
37+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Andrew Walsh
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<a name="readme-top"></a>
2+
3+
[![MIT License][license-shield]][license-url]
4+
5+
<!-- PROJECT LOGO -->
6+
<br />
7+
<div align="center">
8+
<a href="https://github.com/AndrewWalsh/openapi-devtools">
9+
<img src="resources/logo.svg" alt="Open API dev tools" width="300" height="250">
10+
</a>
11+
12+
13+
<p align="center">
14+
Effortlessly discover API behaviour with a Chrome extension that automatically generates OpenAPI specifications in real time for any app or website.
15+
<br />
16+
<br />
17+
<a href="https://github.com/AndrewWalsh/openapi-devtools/issues">Report Bug</a>
18+
·
19+
<a href="https://github.com/AndrewWalsh/openapi-devtools/issues">Request Feature</a>
20+
</p>
21+
</div>
22+
23+
## About The Project
24+
25+
<p align="center" width="100%">
26+
<img width="80%" src="resources/demo.gif">
27+
</p>
28+
29+
OpenAPI DevTools is a Chrome extension that generates OpenAPI specifications in real time from network requests. Once installed it adds a new tab to Chrome DevTools called `OpenAPI`. While the tool is open it automatically converts network requests into a specification.
30+
31+
*Features*:
32+
- Instantly generate an OpenAPI 3.1 specification for any website or application just by using it
33+
- Automatically merges new request & response headers, bodies, and query parameters per endpoint
34+
- Click on a [path parameter](https://www.abstractapi.com/api-glossary/path-parameters) and the app will automatically merge existing and future matching requests
35+
- View the specification inside the tool using [Redocly](https://www.npmjs.com/package/redoc) and download with a click
36+
37+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
38+
39+
## Installation
40+
41+
<p align="center" width="100%">
42+
<img width="80%" src="resources/demo-img.png">
43+
</p>
44+
45+
- [Download and extract the zip](https://github.com/AndrewWalsh/openapi-devtools/blob/main/resources/dist.zip)
46+
- In Chrome, navigate to `chrome://extensions`
47+
- In the top right enable the `Developer mode` toggle
48+
- In the top left click `Load unpacked` and select the extracted `dist` directory
49+
- Open a new tab and then select `OpenAPI` in the developer tools (open with `cmd+i` or `ctrl+i`)
50+
51+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
52+
53+
## Usage
54+
55+
The specification will automatically populate based on JSON requests that fire as you browse the web. In the settings menu you can filter hosts and parameterise paths in URLs. Once you do so all matching existing and future requests to that endpoint will be merged. This process is irreversible, but you can clear the specification and restart at any time.
56+
57+
When the same endpoint responds with different data, such as a value that is sometimes a string and sometimes null, the specification for that value will be *either* string or null. All information is accounted for in the final specification. If you see something missing from a request, trigger a request that contains the missing information.
58+
59+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
60+
61+
## Contributing
62+
63+
To develop the project:
64+
- `npm install`
65+
- `npm run build`
66+
- Navigate to `chrome://extensions`
67+
- In the top right enable the `Developer mode` toggle
68+
- In the top left click `Load unpacked` and select the extracted `dist` directory
69+
- You should now see the tool in Chrome DevTools. You can interact it with like a regular page, including inspection of the React app.
70+
- [Extensions Reloader](https://chrome.google.com/webstore/detail/extensions-reloader/fimgfedafeadlieiabdeeaodndnlbhid) is suggested to update the tool after running `npm run build` and updating the `dist` directory
71+
72+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
73+
74+
<!-- MARKDOWN LINKS & IMAGES -->
75+
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
76+
[license-url]: https://github.com/AndrewWalsh/openapi-devtools/blob/main/LICENSE.txt
77+
[license-shield]: https://img.shields.io/github/license/othneildrew/Best-README-Template.svg?style=for-the-badge

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/gear.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>OpenAPI Devtools</title>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script type="module" src="/src/loadPanel.js"></script>
12+
</body>
13+
</html>

manifest.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"manifest_version": 3,
3+
"name": "openapi-devtools",
4+
"version": "1.0.0",
5+
"devtools_page": "index.html",
6+
"permissions": [],
7+
"icons": {
8+
"16": "icon16.png",
9+
"32": "icon32.png",
10+
"48": "icon48.png",
11+
"128": "icon128.png"
12+
}
13+
}

0 commit comments

Comments
 (0)