|
| 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 |
0 commit comments