Skip to content

Commit 90021ad

Browse files
authored
Merge pull request swagger-api#2567 from monkeyFeathers/swagger-ui#2561
Replace resource ID special characters to fix path expansion issue
2 parents 5846014 + 6736131 commit 90021ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/javascript/view/MainView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ SwaggerUi.Views.MainView = Backbone.View.extend({
111111

112112
addResource: function(resource, auths){
113113
// Render a resource and add it to resources li
114-
resource.id = resource.id.replace(/[[\]{}()*+?,\\/^$|#\s]/g, '_');
114+
resource.id = resource.id.replace(/[^a-zA-Z\d]/g, function(str) { return str.charCodeAt(0); });
115115

116116
// Make all definitions available at the root of the resource so that they can
117117
// be loaded by the JSonEditor

0 commit comments

Comments
 (0)