File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed
services/parsers/open-api-v3 Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,13 @@ export abstract class ParserBaseService {
120120 defaultName : string ,
121121 mediaType : string = null ,
122122 ) : ModelAttributessModel {
123+ if ( ! schema ) {
124+ console . warn ( 'WARNING: No schema defined! Any will be use instead' ) ;
125+ console . warn ( 'TIP: Don\'t fill "content" for responses if void' ) ;
126+ const instance = new ModelAttributessModel ( null ) ;
127+ instance . typeURI = 'void' ;
128+ return instance ;
129+ }
123130 if ( this . isRefObject ( schema ) ) {
124131 const instance = new ModelAttributessModel ( null ) ;
125132 instance . typeURI = schema . $ref ;
Original file line number Diff line number Diff line change @@ -5,18 +5,21 @@ import { Store } from '../stores/entities.store';
55
66export function getFixedTypeName ( type : string ) : string {
77 let parsedTypes = {
8+ '' : 'any' ,
9+ any : 'any' ,
10+ array : 'any[]' ,
811 bool : 'boolean' ,
912 boolean : 'boolean' ,
10- string : 'string' ,
11- integer : 'number' ,
1213 double : 'number' ,
14+ empty : 'void' ,
15+ file : 'File' ,
1316 float : 'number' ,
17+ integer : 'number' ,
1418 number : 'number' ,
15- array : 'any[]' ,
16- '' : 'any' ,
17- undefined : 'any' ,
1819 object : 'any' ,
19- any : 'any' ,
20+ string : 'string' ,
21+ undefined : 'any' ,
22+ void : 'void' ,
2023 } ;
2124
2225 let newType = parsedTypes [ type ] ;
You can’t perform that action at this time.
0 commit comments