File tree Expand file tree Collapse file tree 4 files changed +16
-2
lines changed
services/parsers/open-api-v3 Expand file tree Collapse file tree 4 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66
77## [ Unreleased]
88
9+ ### Added
10+ - Support for arrays in ` api ` responses.
11+
912## [ 2.5.1] - 2021-02-04
1013
1114### Added
Original file line number Diff line number Diff line change @@ -36,6 +36,14 @@ export class ApiModel implements PhysycalFile {
3636 return ! this . response || this . response ?. typeIsPrimitive ;
3737 }
3838
39+ get isResponseArray ( ) : boolean {
40+ return this . response ?. isArray ;
41+ }
42+
43+ get responseArrayLevelsRepeater ( ) : any [ ] {
44+ return this . response ?. arrayLevelsRepeater ;
45+ }
46+
3947 get models ( ) : ModelAttributessModel [ ] {
4048 return [ this . queryParams , this . requestBody , this . response ] . filter (
4149 ( el ) => ! ! el ,
@@ -58,7 +66,7 @@ export class ApiModel implements PhysycalFile {
5866 }
5967
6068 get hasComments ( ) : boolean {
61- return ! ! this . description || ! ! this . example || ! ! this . deprecated ;
69+ return ! ! this . description || ! ! this . example || ! ! this . deprecated ;
6270 }
6371
6472 get queryParamsType ( ) : string {
Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ export abstract class ParserBaseService {
164164 if ( schema . type === 'array' ) {
165165 const instance = this . parseSchema ( schema . items , defaultName , mediaType ) ;
166166 instance . isArray = true ;
167+ instance . arrayLevels ++ ;
167168 return instance ;
168169 }
169170
Original file line number Diff line number Diff line change @@ -53,7 +53,9 @@ export class {{groupName}}Service {
5353 #requestBodyType} }
5454 requestBody : { { . } } , { { / requestBodyType
5555 } }
56- ) : Observable < { { responseType } } > {
56+ ) : Observable < { { responseType } } { {
57+ #responseArrayLevelsRepeater} } [ ] { { / responseArrayLevelsRepeater
58+ } } > {
5759 return this . apiService . do { { verb} } (
5860 '{{{ url }}}' ,
5961 { { #queryParamsType} } uriOptions { { / queryParamsType} } { { ^ queryParamsType} } null { { / queryParamsType} } ,
You can’t perform that action at this time.
0 commit comments