Skip to content

Commit

Permalink
Release v3.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
KostyaTretyak committed Apr 14, 2021
1 parent 89251eb commit d310ae3
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 7 deletions.
8 changes: 6 additions & 2 deletions versions/3.1/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@

### Features

- Added extended interfaces with a prefix `X`.
- Added `openapi` constant to exports.

<a name="3.1.0"></a>
## [3.1.0](https://github.com/ts-stack/openapi-spec/releases/tag/3.1.0) (2021-02-17)
## [3.1.0](https://github.com/ts-stack/openapi-spec/releases/tag/3.1.0) (2021-03-26)

### Breaking Changes

- Renamed `SpecificationExtensions` to `SpecificationExtension` (see [ba01484](https://github.com/ts-stack/openapi-spec/commit/ba01484)).
- Removed default type for `SpecificationExtension` generic.
- Reflect diff between OpenAPI Specification v3.1.0-rc.1 and v3.1.0.

### Features

- Added extended interfaces with a prefix `X`.
12 changes: 11 additions & 1 deletion versions/3.1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ but the patch version is not the same:

| OpenAPI Specification | @ts-stack/openapi-spec |
|-------------------------|-------------------------|
| v3.1.0 | <ul><li>v3.1.0</li></ul> |
| v3.1.0 | <ul><li>v3.1.0</li><li>v3.1.1</li></ul> |


## Introduction
Expand All @@ -31,6 +31,16 @@ npm i @ts-stack/openapi-spec

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

## openapi version usage

You can use the `openapi` constant that contains the version of the OpenAPI Specification:

```ts
import { openapi } from '@ts-stack/openapi-spec';

console.log(openapi) // 3.1.0
```

## SpecificationExtension Usage

If you want to use already extended interfaces, you need to import interfaces with the `X` prefix:
Expand Down
10 changes: 10 additions & 0 deletions versions/3.1/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/**
* This string is the [version number][1] of the [OpenAPI Specification version][1]
* that the OpenAPI document uses. The `openapi` field SHOULD be used by tooling specifications and
* clients to interpret the OpenAPI document. This is _not_ related to the API [info.version][3]
* string.
*
* [1]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#versions
* [3]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#infoVersion
*/
export const openapi = '3.1.0';
export * from './src/origin/base-parameter-object';
export * from './src/origin/callback-object';
export * from './src/origin/components-object';
Expand Down
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/openapi-spec",
"version": "3.1.0",
"version": "3.1.1",
"description": "This is OpenAPI Specification v3.1.0 writen in TypeScript.",
"main": "dist/index",
"typings": "dist/index",
Expand Down
2 changes: 1 addition & 1 deletion versions/3.1/src/extended/oas-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export type XOasObject<T extends SpecExtFieldPattern = any> = SpecificationExten
* string.
*
* [1]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#versions
* [3]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#info-version
* [3]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#infoVersion
*/
openapi: string;
/**
Expand Down
2 changes: 1 addition & 1 deletion versions/3.1/src/extended/request-body-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export type XRequestBodyObject<T extends SpecExtFieldPattern = any> = Specificat
*
* [1]: https://tools.ietf.org/html/rfc7231#appendix-D
*/
content: { [contentName: string]: XMediaTypeObject };
content: { [mediaTypeName: string]: XMediaTypeObject };
/**
* Determines if the request body is required in the request. Defaults to `false`.
*/
Expand Down
2 changes: 1 addition & 1 deletion versions/3.1/src/origin/request-body-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export interface RequestBodyObject {
*
* [1]: https://tools.ietf.org/html/rfc7231#appendix-D
*/
content: { [contentName: string]: MediaTypeObject };
content: { [mediaTypeName: string]: MediaTypeObject };
/**
* Determines if the request body is required in the request. Defaults to `false`.
*/
Expand Down

0 comments on commit d310ae3

Please sign in to comment.