@@ -255,6 +255,14 @@ SwaggerUi.partials.signature = (function () {
255
255
var type = schema . type || 'object' ;
256
256
var isArray = type === 'array' ;
257
257
258
+ if ( ! _ . isUndefined ( schema . description ) ) {
259
+ html += ': ' + '<span class="propDesc">' + schema . description + '</span>' ;
260
+ }
261
+
262
+ if ( schema . enum ) {
263
+ html += ' = <span class="propVals">[\'' + schema . enum . join ( '\', \'' ) + '\']</span>' ;
264
+ }
265
+
258
266
if ( isArray ) {
259
267
if ( _ . isPlainObject ( schema . items ) && ! _ . isUndefined ( schema . items . type ) ) {
260
268
type = schema . items . type ;
@@ -404,16 +412,13 @@ SwaggerUi.partials.signature = (function () {
404
412
var requiredClass = propertyIsRequired ? 'required' : '' ;
405
413
var html = '<span class="propName ' + requiredClass + '">' + name + '</span> (' ;
406
414
var model ;
407
- var propDescription ;
408
415
409
416
// Allow macro to set the default value
410
417
cProperty . default = modelPropertyMacro ( cProperty ) ;
411
418
412
419
// Resolve the schema (Handle nested schemas)
413
420
cProperty = resolveSchema ( cProperty ) ;
414
421
415
- propDescription = property . description || cProperty . description ;
416
-
417
422
// We need to handle property references to primitives (Issue 339)
418
423
if ( ! _ . isUndefined ( cProperty . $ref ) ) {
419
424
model = models [ simpleRef ( cProperty . $ref ) ] ;
@@ -436,14 +441,6 @@ SwaggerUi.partials.signature = (function () {
436
441
437
442
html += ')' ;
438
443
439
- if ( ! _ . isUndefined ( propDescription ) ) {
440
- html += ': ' + '<span class="propDesc">' + propDescription + '</span>' ;
441
- }
442
-
443
- if ( cProperty . enum ) {
444
- html += ' = <span class="propVals">[\'' + cProperty . enum . join ( '\', \'' ) + '\']</span>' ;
445
- }
446
-
447
444
return '<div' + ( property . readOnly ? ' class="readOnly"' : '' ) + '>' + primitiveToOptionsHTML ( cProperty , html ) ;
448
445
} ) . join ( ',</div>' ) ;
449
446
}
0 commit comments