Skip to content

Commit 8b9cf22

Browse files
committed
Adjust README to reflect type conversion related changes
1 parent ddc2782 commit 8b9cf22

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ The purpose of this project is to fill the gap by doing the conversion between t
1515
## Features
1616

1717
* converts OpenAPI 3.0 Schema Object to JSON Schema Draft 4
18-
* converts [common named data types](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types) to `type` and `format`
19-
* for example `type: "dateTime"` becomes `type: "string"` with `format: "date-time"`
18+
* ~~converts [common named data types](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types) to `type` and `format`~~ *(removed in version 2.0.0)*
19+
* ~~for example `type: "dateTime"` becomes `type: "string"` with `format: "date-time"`~~
2020
* deletes `nullable` and adds `"null"` to `type` array if `nullable` is `true`
2121
* supports deep structures with nested `allOf`s etc.
2222
* removes [OpenAPI specific properties](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#fixed-fields-20) such as `discriminator`, `deprecated` etc. unless specified otherwise
@@ -39,7 +39,8 @@ Here's a small example to get the idea:
3939
var toJsonSchema = require('openapi-schema-to-json-schema');
4040

4141
var schema = {
42-
type: 'dateTime',
42+
type: 'string',
43+
format: 'date-time',
4344
nullable: true
4445
};
4546

@@ -70,15 +71,14 @@ If set to `false`, converts the provided schema in place. If `true`, clones the
7071

7172
#### `dateToDateTime` (boolean)
7273

73-
This is `false` by default and leaves `date` type/format as is. If set to `true`, sets `type: "string"` and `format: "date-time"` if
74-
* `type: "string"` AND `format: "date"` OR
75-
* `type: "date"`
74+
This is `false` by default and leaves `date` format as is. If set to `true`, sets `format: 'date'` to `format: 'date-time'`.
7675

7776
For example
7877

7978
```js
8079
var schema = {
81-
type: 'date'
80+
type: 'string',
81+
format: 'date'
8282
};
8383

8484
var convertedSchema = toJsonSchema(schema, {dateToDateTime: true});

0 commit comments

Comments
 (0)