File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed
src/schema-parser/complex-schema-parsers Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change 1
1
# next release
2
2
3
+ fix: problem with using ` anyOf `
4
+
3
5
## 13.0.0
4
6
5
7
BREAKING_CHANGE: disable support NodeJS 14.x
Original file line number Diff line number Diff line change 1
1
const { MonoSchemaParser } = require ( '../mono-schema-parser' ) ;
2
2
const _ = require ( 'lodash' ) ;
3
3
4
- // T1 | T2 | (T1 & T2)
4
+ // T1 | T2
5
5
class AnyOfSchemaParser extends MonoSchemaParser {
6
6
parse ( ) {
7
7
const ignoreTypes = [ this . config . Ts . Keyword . Any ] ;
@@ -12,20 +12,13 @@ class AnyOfSchemaParser extends MonoSchemaParser {
12
12
this . schemaPath ,
13
13
) ,
14
14
) ;
15
+
15
16
const filtered = this . schemaUtils . filterSchemaContents (
16
17
combined ,
17
18
( content ) => ! ignoreTypes . includes ( content ) ,
18
19
) ;
19
20
20
- const type = this . config . Ts . UnionType (
21
- _ . compact ( [
22
- ...filtered ,
23
- filtered . length > 1 &&
24
- this . config . Ts . ExpressionGroup (
25
- this . config . Ts . IntersectionType ( filtered ) ,
26
- ) ,
27
- ] ) ,
28
- ) ;
21
+ const type = this . config . Ts . UnionType ( filtered ) ;
29
22
30
23
return this . schemaUtils . safeAddNullToType ( this . schema , type ) ;
31
24
}
You can’t perform that action at this time.
0 commit comments