% if( _.isUndefined( headerNode ) ) var headerNode = 'h3'; var skippedAttributes = [ 'x-resourceId','x-entryPoint','x-extensionDetection','x-throwOnInvalidExtension', 'x-request-samples' ]; var xAttributes = []; _.each( _.keys( entity ), function( nodeName ){ if( nodeName.indexOf( 'x-' ) === 0 && skippedAttributes.indexOf( nodeName ) === -1 ){ var attributeArray = nodeName.split( '-' ); attributeArray.splice( 0, 1 ); var attributeName = attributeArray.join( ' ' ).toProperCase(); xAttributes.push( { "name": attributeName, "value": entity[ nodeName ] } ); } }); %> <% if( xAttributes.length > 0) { %> <<%=headerNode%> class="text-primary">Extended Attributes:<%=headerNode%>>
Name | Value |
---|---|
<%= xAttribute.name %> |
<%
switch ( typeof( xAttribute.value ) ) {
case 'object':
case 'array':
var attributeValue = formatAPIExample( JSON.stringify( xAttribute.value ), "application/json" );
var brushType = 'json';
break;
default:
var attributeValue =xAttribute.value;
}
%>
<% if ( !_.isUndefined( brushType ) ){ %>
<% } else { %>
<%=attributeValue%>
<% } %>
|