@@ -292,7 +292,8 @@ export class AmfSerializer extends AmfHelperMixin(Object) {
292
292
* @returns {ApiServer } Serialized Server
293
293
*/
294
294
server ( object ) {
295
- const url = this . _getValue ( object , this . ns . aml . vocabularies . core . urlTemplate ) || '' ;
295
+ const { ns } = this ;
296
+ const url = this . _getValue ( object , ns . aml . vocabularies . core . urlTemplate ) || '' ;
296
297
const result = /** @type ApiServer */ ( {
297
298
id : object [ '@id' ] ,
298
299
types : object [ '@type' ] . map ( this [ expandKey ] . bind ( this ) ) ,
@@ -301,19 +302,23 @@ export class AmfSerializer extends AmfHelperMixin(Object) {
301
302
customDomainProperties : this . customDomainProperties ( object ) ,
302
303
sourceMaps : this . sourceMap ( object ) ,
303
304
} ) ;
304
- const variables = /** @type Parameter[] */ ( object [ this . _getAmfKey ( this . ns . aml . vocabularies . apiContract . variable ) ] ) ;
305
+ const description = this . _getValue ( object , ns . aml . vocabularies . core . description ) ;
306
+ if ( description && typeof description === 'string' ) {
307
+ result . description = description ;
308
+ }
309
+ const variables = /** @type Parameter[] */ ( object [ this . _getAmfKey ( ns . aml . vocabularies . apiContract . variable ) ] ) ;
305
310
if ( Array . isArray ( variables ) && variables . length ) {
306
311
result . variables = variables . map ( ( p ) => this . parameter ( p ) ) ;
307
312
}
308
- const protocol = /** @type string */ ( this . _getValue ( object , this . ns . aml . vocabularies . apiContract . protocol ) ) ;
309
- const protocolVersion = /** @type string */ ( this . _getValue ( object , this . ns . aml . vocabularies . apiContract . protocolVersion ) ) ;
313
+ const protocol = /** @type string */ ( this . _getValue ( object , ns . aml . vocabularies . apiContract . protocol ) ) ;
314
+ const protocolVersion = /** @type string */ ( this . _getValue ( object , ns . aml . vocabularies . apiContract . protocolVersion ) ) ;
310
315
if ( protocol ) {
311
316
result . protocol = protocol ;
312
317
}
313
318
if ( protocolVersion ) {
314
319
result . protocolVersion = protocolVersion ;
315
320
}
316
- const security = /** @type SecurityRequirement */ ( object [ this . _getAmfKey ( this . ns . aml . vocabularies . security . security ) ] ) ;
321
+ const security = /** @type SecurityRequirement */ ( object [ this . _getAmfKey ( ns . aml . vocabularies . security . security ) ] ) ;
317
322
if ( Array . isArray ( security ) && security . length ) {
318
323
result . security = security . map ( ( p ) => this . securityRequirement ( p ) ) ;
319
324
}
0 commit comments