Skip to content

Commit 2cfdaf1

Browse files
authored
Merge pull request #144 from akeneo/fix-entity-format
Fix Handlebars to handle more json formats
2 parents 53072e3 + 0ab1966 commit 2cfdaf1

File tree

1 file changed

+31
-13
lines changed

1 file changed

+31
-13
lines changed

src/api-reference/reference.handlebars

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,26 @@
228228
{{#if x-warning}}
229229
<a href="#" data-placement="top" data-toggle="tooltip" title="{{{x-warning}}}"> <i class="fa fa-warning fa-warning-color"></i> </a>
230230
{{/if}}
231-
&bull; {{{description}}}
231+
{{#with items}}
232+
{{#if properties}} : [ <br> &nbsp; &nbsp; &nbsp; &nbsp; { <br>
233+
{{#each properties}}
234+
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
235+
<code>{{{@key}}}</code>
236+
<em>
237+
({{{type}}}
238+
{{#if items}}
239+
[{{{items.type}}}
240+
]{{/if}})
241+
</em>
242+
&bull; {{{description}}} <br>
243+
{{/each}}
244+
&nbsp; &nbsp; &nbsp; &nbsp; } <br> &nbsp; &nbsp; ]
245+
{{else}}
246+
&bull; {{{../description}}}
247+
{{/if}}
248+
{{else}}
249+
&bull; {{{description}}}
250+
{{/with}}
232251
</p>
233252
{{/each}}
234253
<p>}</p>
@@ -296,6 +315,7 @@
296315
<em> ({{{type}}} {{#if items}} [{{{items.type}}}] {{/if}}) </em>
297316
{{#if properties}}: { <br>
298317
{{#each properties}}
318+
&nbsp; &nbsp;
299319
<code>{{{@key}}}</code>
300320
<em>
301321
({{{type}}}
@@ -317,7 +337,6 @@
317337
&bull; {{{description}}}{{#unless @last}} <br> {{/unless}}
318338
{{/each}}
319339
<br>&nbsp; &nbsp; }
320-
<br>
321340
{{else}}
322341
{{#with items}}
323342
{{#if allOf}}
@@ -350,13 +369,11 @@
350369
<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
351370
} <br>
352371
{{else}}
353-
&bull; {{{description}}}
354-
<br>
372+
&bull; {{{description}}} <br>
355373
{{/if}}
356374
{{/each}}
357375
{{/each}}
358-
&nbsp; &nbsp; &nbsp; &nbsp; } <br> &nbsp; &nbsp;
359-
]
376+
&nbsp; &nbsp; &nbsp; &nbsp; } <br> &nbsp; &nbsp; ]
360377
{{/if}}
361378
{{#if properties}} : [
362379
<br> &nbsp; &nbsp; &nbsp; &nbsp; { <br>
@@ -371,18 +388,19 @@
371388
</em>
372389
&bull; {{{description}}} <br>
373390
{{/each}}
374-
&nbsp; &nbsp; &nbsp; &nbsp; } <br> &nbsp; &nbsp; ] <br>
391+
&nbsp; &nbsp; &nbsp; &nbsp; } <br> &nbsp; &nbsp; ]
375392
{{else}}
376-
&bull; {{{description}}} <br>
393+
&bull; {{{description}}}
377394
{{/if}}
395+
{{else}}
396+
&bull; {{{description}}}
378397
{{/with}}
379398
{{/if}}
380-
{{#unless @last}} <br> {{/unless}}
381399
{{/each}}
382-
&nbsp; }
383-
{{else}}
384-
&bull; {{{description}}}</p>
385-
{{/if}}
400+
<br> &nbsp; }
401+
{{else}}
402+
&bull; {{{description}}}
403+
{{/if}}
386404
{{/each}}
387405
{{#each allOf}}
388406
{{#each properties}}

0 commit comments

Comments
 (0)