implement option to control whether models are displayed as valid JSON schema or the docs rendering (with descriptions) by default

This commit is contained in:
Sean Kennedy
2015-11-20 15:11:15 -05:00
parent 1dc7894365
commit 1ccab589f8
7 changed files with 28 additions and 8 deletions

View File

@@ -13,7 +13,12 @@ window.SwaggerUi = Backbone.Router.extend({
// SwaggerUi accepts all the same options as SwaggerApi
initialize: function(options) {
options = options || {};
if(!options.highlightSizeThreshold) {
if (options.defaultModelRendering !== 'model') {
options.defaultModelRendering = 'schema';
}
if (!options.highlightSizeThreshold) {
options.highlightSizeThreshold = 100000;
}