Skip to content

Commit

Permalink
docs: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Dafnik committed Oct 9, 2024
1 parent 2ad29a1 commit ecab41f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,13 @@ Build upon the excellence of Bootstrap Icons providing you with over 2,000 icons
[![npm downloads per week](https://img.shields.io/npm/dw/dfx-bootstrap-icons?logo=npm&color=%237469B6)](https://npmjs.org/package/dfx-bootstrap-icons)
[![npm bundle size](https://img.shields.io/bundlephobia/min/dfx-bootstrap-icons?color=%237469B6&cacheSeconds=86400)](https://npmjs.org/package/dfx-bootstrap-icons)
[![npm license](https://img.shields.io/npm/l/dfx-bootstrap-icons?color=%237469B6&cacheSeconds=86400)](https://github.com/Dafnik/dfts-common)

### dfx-openapi

`dfx-openapi` is a type-safe Angular HttpClient that pulls in your OpenAPI schema.
It has virtually zero runtime and is fully compatible with Http Interceptors.

[![npm version](https://img.shields.io/npm/v/dfx-openapi?label=version&color=%237469B6&cacheSeconds=86400)](https://npmjs.org/package/dfx-openapi)
[![npm downloads per week](https://img.shields.io/npm/dw/dfx-openapi?logo=npm&color=%237469B6)](https://npmjs.org/package/dfx-openapi)
[![npm bundle size](https://img.shields.io/bundlephobia/min/dfx-openapi?color=%237469B6&cacheSeconds=86400)](https://npmjs.org/package/dfx-openapi)
[![npm license](https://img.shields.io/npm/l/dfx-openapi?color=%237469B6&cacheSeconds=86400)](https://github.com/Dafnik/dfts-common)
14 changes: 7 additions & 7 deletions libs/dfx-openapi/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# dfx-openapi

[![npm version](https://img.shields.io/npm/v/dfx-openapi?label=version&color=%237469B6&cacheSeconds=86400)](https://npmjs.org/package/dfts-qrcode)
[![npm downloads per week](https://img.shields.io/npm/dw/dfx-openapi?logo=npm&color=%237469B6)](https://npmjs.org/package/dfts-qrcode)
[![npm bundle size](https://img.shields.io/bundlephobia/min/dfx-openapi?color=%237469B6&cacheSeconds=86400)](https://npmjs.org/package/dfts-qrcode)
[![npm version](https://img.shields.io/npm/v/dfx-openapi?label=version&color=%237469B6&cacheSeconds=86400)](https://npmjs.org/package/dfx-openapi)
[![npm downloads per week](https://img.shields.io/npm/dw/dfx-openapi?logo=npm&color=%237469B6)](https://npmjs.org/package/dfx-openapi)
[![npm bundle size](https://img.shields.io/bundlephobia/min/dfx-openapi?color=%237469B6&cacheSeconds=86400)](https://npmjs.org/package/dfx-openapi)

`dfx-openapi` is a type-safe Angular HttpClient that pulls in your OpenAPI schema.
It has virtually zero runtime and is fully compatible with Http Interceptors.
It has virtually zero runtime and is fully compatible with Http interceptors.

The syntax is inspired by openapi-fetch.

Expand Down Expand Up @@ -76,16 +76,16 @@ npm i -D openapi-typescript
>
> Enable [noUncheckedIndexedAccess](https://www.typescriptlang.org/tsconfig/#noUncheckedIndexedAccess) in your `tsconfig.json` ([docs](https://openapi-ts.dev/advanced#enable-nouncheckedindexedaccess-in-tsconfig))
Next, generate TypeScript types from your OpenAPI schema using openapi-typescript:
Next, generate TypeScript types from your OpenAPI schema using [openapi-typescript](https://openapi-ts.dev/):

```shell
npx openapi-typescript ./path/to/api/v1.yaml -o ./src/app/api/v1.d.ts
```

## Basic usage

The best part about using dfx-openapi over oldschool codegen is no documentation needed.
dfx-openapi encourages using your existing OpenAPI documentation rather than trying to find what function to import, or what parameters that function wants:
The best part about using `dfx-openapi` over oldschool codegen is no documentation needed.
`dfx-openapi` encourages using your existing OpenAPI documentation rather than trying to find what function to import, or what parameters that function wants:

```typescript
import { inject, Injectable } from '@angular/core';
Expand Down

0 comments on commit ecab41f

Please sign in to comment.