Skip to content

Commit 31c17da

Browse files
authored
Fixed check for supported content types. (#1657)
1 parent afb25f5 commit 31c17da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/models/representationExample.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class RepresentationExample {
2727
*/
2828
public readonly contentType: string
2929
) {
30-
if (this.contentType.includes("/xml")) {
30+
if (/\bxml\b/i.test(this.contentType)) {
3131
this.value = Utils.formatXml(value);
3232
this.format = "xml";
3333

@@ -36,7 +36,7 @@ export class RepresentationExample {
3636
}
3737
}
3838

39-
if (this.contentType.includes("/json")) {
39+
if (/\bjson\b/i.test(this.contentType)) {
4040
this.value = Utils.formatJson(value);
4141
this.format = "json";
4242

0 commit comments

Comments
 (0)