File tree Expand file tree Collapse file tree
services/parsers/open-api-v3 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export class ApiModel implements PhysycalFile {
1818 queryParams : ModelAttributessModel ;
1919 requestContentType ?: string ;
2020 requestBody : ModelAttributessModel ;
21+ responseContentType ?: string ;
2122 response : ModelAttributessModel ;
2223
2324 get name ( ) : string {
@@ -40,6 +41,26 @@ export class ApiModel implements PhysycalFile {
4041 return this . response ?. isArray ;
4142 }
4243
44+ get isResponseTypeText ( ) : boolean {
45+ return this . responseContentType ?. indexOf ( 'text/' ) === 0 ;
46+ }
47+
48+ get isResponseTypeJson ( ) : boolean {
49+ return this . responseContentType === 'application/json' ;
50+ }
51+
52+ get isResponseTypeXML ( ) : boolean {
53+ return this . responseContentType === 'application/xml' ;
54+ }
55+
56+ get isResponseTypeFile ( ) : boolean {
57+ return (
58+ ! this . isResponseTypeText &&
59+ ! this . isResponseTypeJson &&
60+ ! this . isResponseTypeXML
61+ ) ;
62+ }
63+
4364 get responseArrayLevelsRepeater ( ) : any [ ] {
4465 return this . response ?. arrayLevelsRepeater ;
4566 }
Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ export class APIParserService extends ParserBaseService {
105105 if ( this . isResponseObject ( response ) ) {
106106 const keys = Object . keys ( response . content ) ;
107107 const mainKey = keys [ 0 ] ;
108+ apiModel . responseContentType = mainKey ;
108109 apiModel . response = this . parseSchema (
109110 response . content [ mainKey ] . schema ,
110111 getApiDefaultModelName ( apiModel , 'Response' ) ,
You can’t perform that action at this time.
0 commit comments