Fix escaping resource name.

This commit is contained in:
Sreenidhi Sreesha
2016-09-01 13:58:23 -07:00
parent 2ba1c100ae
commit 878dad251d

View File

@@ -111,7 +111,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
addResource: function(resource, auths){
// Render a resource and add it to resources li
resource.id = resource.id.replace(/\s/g, '_');
resource.id = resource.id.replace(/[[\]{}()*+?,\\/^$|#\s]/g, '_');
// Make all definitions available at the root of the resource so that they can
// be loaded by the JSonEditor