@harnessio/react-api-testing-service-client
v0.4.0
Published
Harness React API Testing service client - API Testing APIs integrated with react hooks
Downloads
10,297
Keywords
Readme
React API Testing Service Client (WIP)
OpenAPI -> OA
TypeScript -> TS
OpenAPI + TypeScript -> OATS
This React API client stores a collection of Harness API Testing Service APIs and interface contracts generated from the OpenAPI spec using OATS CLI internally.
APIs use hooks from @tanstack/react-query.
The spec (swagger.json) is generated by the API Testing server (tsoa) and copied from
services/api-testing/server/src/swagger.json. Re-copy it and run yarn generate when the server contract changes.
Steps To Generate API Client build as dist folder
yarn buildFor NextGen UI adoption : APITestingServiceAPIClient should be initialized
Before using the API Client, it must be initialized with the required ClientCallbacks.
Example:
new APITestingServiceAPIClient({
getRequestHeaders: () => {
return { token: SessionToken.getToken(), 'Harness-Account': accountId }
}})Versioning
Once the development phase is completed, this repo will have changes and versioning driven by the API spec only.
License
MIT. Copyright(c) Harness Inc
