@principlestudios/openapi-codegen-typescript-rxjs
TypeScript icon, indicating that this package has built-in type declarations

0.7.0 • Public • Published

OpenAPI Codegen for a TypeScript-friendly RxJS client

Provides an adapter layer method for @principlestudios/openapi-codegen-typescript to integrate with rxjs.

npm i -D @principlestudios/openapi-codegen-typescript-rxjs

You must also have dotnet 8.0 runtime installed on your machine.

This will provide a corresponding bin to generate the typescript files.

openapi-codegen-typescript api.yaml api-generated/ -c

You can then create an API wrapper such as:

import { toRxjsApi } from '@principlestudios/openapi-codegen-typescript-rxjs';
import operations from './api-generated/operations';

const baseDomain = 'http://localhost/';
export default toRxjsApi(operations, baseDomain);

To use within node (such as unit tests), use the universal-rxjs-ajax npm module:

import { toRxjsApi } from '@principlestudios/openapi-codegen-typescript-rxjs';
import operations from './api-generated/operations';
import { request as ajax } from 'universal-rxjs-ajax';

const baseDomain = 'http://localhost/';
export default toRxjsApi(operations, baseDomain, ajax);

This API will use the type safety from OpenAPI along with rxjs.

Dependents (0)

Package Sidebar

Install

npm i @principlestudios/openapi-codegen-typescript-rxjs

Weekly Downloads

11

Version

0.7.0

License

BSD-2-Clause

Unpacked Size

8.76 kB

Total Files

5

Last publish

Collaborators

  • mdekrey
  • mikegeise