Implemented API from code generated by OpenAPI

This commit is contained in:
Koper
2023-08-10 18:33:50 +07:00
parent e1b33b6857
commit e8c054b4ca
24 changed files with 3331 additions and 36 deletions

View File

@@ -10,6 +10,7 @@ Reflector is a React application that uses WebRTC to stream audio from the brows
- [Installation](#installation)
- [Run the Application](#run-the-application)
- [WebRTC Integration](#webrtc-integration)
- [OpenAPI Code Generation](#openapi-code-generation)
- [Contribution Guidelines](#contribution-guidelines)
## Project Architecture
@@ -73,6 +74,16 @@ The received data is expected to be a JSON object containing the live transcript
This data is then returned from the `useWebRTC` hook and can be used in your components.
## OpenAPI Code Generation
To generate the TypeScript files from the openapi.json file, make sure the python server is running, then run:
```
openapi-generator-cli generate -i http://localhost:1250/openapi.json -g typescript-fetch -o app/api
```
You may need to run `yarn global add @openapitools/openapi-generator-cli` first. You also need a Java runtime installed on your machine.
## Contribution Guidelines
All new contributions should be made in a separate branch. Before any code is merged into `master`, it requires a code review.