Skip to content

Commit 92c0bb8

Browse files
authored
fix: improve markdown rendering of nested fields (#149)
1 parent 647e74a commit 92c0bb8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

library/src/helpers/beautifier.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ class Beautifier {
7878
return schema;
7979
}
8080

81+
if (schema.description) {
82+
schema.description = renderMd(schema.description as string);
83+
}
84+
8185
if (schema.properties) {
8286
const properties = schema.properties;
8387
const newProperties: Record<string, Schema> = properties;
@@ -97,6 +101,9 @@ class Beautifier {
97101

98102
prop.properties = newPropProperties;
99103
}
104+
if (prop.items) {
105+
prop.items = this.beautifySchema(prop.items);
106+
}
100107

101108
newProperties[key] = prop;
102109
}
@@ -133,6 +140,10 @@ class Beautifier {
133140
schema.additionalProperties = newAdditionalProperties;
134141
}
135142

143+
if (schema.items) {
144+
schema.items = this.beautifySchema(schema.items);
145+
}
146+
136147
return schema;
137148
}
138149

@@ -165,6 +176,7 @@ class Beautifier {
165176
}
166177
if (message.payload) {
167178
message.payload = this.resolveAllOf(message.payload);
179+
message.payload = this.beautifySchema(message.payload);
168180
}
169181
if (message.headers) {
170182
message.headers = this.resolveAllOf(message.headers);

0 commit comments

Comments
 (0)