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 11# next release
22
3+ fix: problem with using ` anyOf `
4+
35## 13.0.0
46
57BREAKING_CHANGE: disable support NodeJS 14.x
Original file line number Diff line number Diff line change 11const { MonoSchemaParser } = require ( '../mono-schema-parser' ) ;
22const _ = require ( 'lodash' ) ;
33
4- // T1 | T2 | (T1 & T2)
4+ // T1 | T2
55class AnyOfSchemaParser extends MonoSchemaParser {
66 parse ( ) {
77 const ignoreTypes = [ this . config . Ts . Keyword . Any ] ;
@@ -12,20 +12,13 @@ class AnyOfSchemaParser extends MonoSchemaParser {
1212 this . schemaPath ,
1313 ) ,
1414 ) ;
15+
1516 const filtered = this . schemaUtils . filterSchemaContents (
1617 combined ,
1718 ( content ) => ! ignoreTypes . includes ( content ) ,
1819 ) ;
1920
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 ) ;
2922
3023 return this . schemaUtils . safeAddNullToType ( this . schema , type ) ;
3124 }
You can’t perform that action at this time.
0 commit comments