Skip to content

Commit

Permalink
doc: Update usage
Browse files Browse the repository at this point in the history
Signed-off-by: koooge <koooooge@gmail.com>
  • Loading branch information
koooge committed Apr 20, 2023
1 parent 1a0f7c1 commit 8fb1f03
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,30 @@ TypeScript library to help building OpenAPI 3.x compliant API contracts.

Version 4.0 Adds explicit support for OAS 3.0 and OAS 3.1 as separate implementations.

### To use version 3.1
### To use version 3.1 import

From Typescript you can consume it from the library:

```typescript
```js
import { oas31 } from 'openapi3-ts';
```

Or directly named import:
Or directly import from subpath:

```typescript
```js
import { OpenAPIObject, OpenApiBuilder } from 'openapi3-ts/oas31';
```

From a JavaScript application you can import:

```javascript
import { oas31 } from 'openapi3-ts';
```

### To use version 3.0 import

From Typescript you can consume it from the library:

```typescript
```js
import { oas30 } from 'openapi3-ts';
```

Or directly named import:
Or directly import from subpath:

```typescript
```js
import { OpenAPIObject, OpenApiBuilder } from 'openapi3-ts/oas30';
```

From a JavaScript application you can import:

```javascript
import { oas30 } from 'openapi3-ts';
```

## Includes

* `/src/model` TS typed interfaces for helping building a contract.
Expand Down

0 comments on commit 8fb1f03

Please sign in to comment.