Skip to content

Commit 1212e4f

Browse files
author
Alban Bailly
committed
pulling properties
1 parent 7408f47 commit 1212e4f

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/components/2_molecules/ResponseSampleBody.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const ResponseSampleBody = props => {
1919
.filter(v => properties[v] !== null)
2020
.map(p => {
2121
const l = properties[p];
22-
console.log(l);
22+
// console.log(l);
2323
return (
2424
l &&
2525
(l.type !== "array" && l.type !== "object" && p !== "errors"
@@ -46,13 +46,24 @@ export const ResponseSampleBody = props => {
4646
oo.properties
4747
? Object.keys(oo.properties).map(oop => {
4848
const data = oo.properties[oop];
49-
// console.log(data);
5049
return `
5150
"${oop}": ${
5251
data.example
5352
? JSON.stringify(data.example)
54-
: data.type === "object" && data.items
55-
? ""
53+
: data.type === "array" && data.items
54+
? "[" +
55+
Object.keys(data.items.properties).map(di => {
56+
const dis = data.items.properties[di];
57+
console.log(data.items);
58+
return `
59+
"${di}": ${
60+
dis.example
61+
? JSON.stringify(dis.example)
62+
: '""'
63+
}
64+
`;
65+
}) +
66+
"]"
5667
: '""'
5768
}`;
5869
})

0 commit comments

Comments
 (0)