Skip to content

Commit

Permalink
Release v3.1.2-rc.1
Browse files Browse the repository at this point in the history
  • Loading branch information
KostyaTretyak committed Feb 9, 2021
1 parent df2a61e commit 23c8069
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 29 deletions.
27 changes: 0 additions & 27 deletions README.md

This file was deleted.

1 change: 1 addition & 0 deletions README.md
59 changes: 58 additions & 1 deletion versions/3.1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
To use it, required TypeScript v4.1+.

Major and minor versions of `@ts-stack/open-api-spec` are the same as [OpenAPI Specification][1],
but the patch version is not the same. Check the patch version here (in the README).
but the patch version is not the same:

| OpenAPI Specification | @ts-stack/open-api-spec |
|-------------------------|-------------------------|
| v3.1.0-rc.1 | <ul><li>v3.1.0-rc.1</li><li>v3.1.1-rc.1</li><li>v3.1.2-rc.1</li></ul> |


## Introduction

Expand All @@ -25,3 +30,55 @@ npm i @ts-stack/open-api-spec
```

[1]: https://github.com/OAI/OpenAPI-Specification

## SpecificationExtensions Usage

You can extends any of model in this way:

```ts
import { OasObject, SpecificationExtensions } from '@ts-stack/open-api-spec';

type ExtendedOasObject = OasObject & SpecificationExtensions<'x-one' | 'x-two'>;

const extendedOasObject: ExtendedOasObject = {
info: {title: '', version: ''},
openapi: '',
'x-one': '',
'x-two': '',
};
```

Same but with an interface to extends properties:

```ts
import { OasObject, SpecificationExtensions } from '@ts-stack/open-api-spec';

interface ExtendedProperties {
'x-one': any,
'x-two': any
}

type ExtendedOasObject = OasObject & SpecificationExtensions<keyof ExtendedProperties>;

const extendedOasObject: ExtendedOasObject = {
info: {title: '', version: ''},
openapi: '',
'x-one': '',
'x-two': '',
};
```

## PathsObject Usage

```ts
import { PathsObject } from '@ts-stack/open-api-spec';

type Paths = '/one' | '/two';

type StrictDifinedPaths = PathsObject<Paths>;

const paths: StrictDifinedPaths = {
'/one': {},
'/two': {},
};
```
2 changes: 1 addition & 1 deletion versions/3.1/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ts-stack/open-api-spec",
"version": "3.1.1-rc.1",
"version": "3.1.2-rc.1",
"description": "This is OpenAPI Specification v3.1.0-rc.1 writen in TypeScript.",
"main": "dist/index",
"typings": "dist/index",
Expand Down

0 comments on commit 23c8069

Please sign in to comment.