Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
For #531. Escape HTML when serializing swagger to string (#532)
Browse files Browse the repository at this point in the history
Co-authored-by: Levi Muriuki <muriukilm@upmc.edu>
  • Loading branch information
levimatheri and Levi Muriuki committed Jun 28, 2021
1 parent 26b7048 commit 0f129dc
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -52,7 +52,8 @@ public string GetDefinition()
}
else
{
return JsonConvert.SerializeObject(definition_);
// include StringEscaping to ensure single quotes are escaped
return JsonConvert.SerializeObject(definition_, settings: new JsonSerializerSettings { StringEscapeHandling = StringEscapeHandling.EscapeHtml});
}
}

Expand Down

0 comments on commit 0f129dc

Please sign in to comment.