Merge pull request #137 from noliran/issue-98

Add support for displaying nested objects and arrays in definitions
This commit is contained in:
Kam Low 2018-04-15 18:16:00 +02:00 committed by GitHub
commit b3bb546fd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2094 additions and 0 deletions

View File

@ -28,6 +28,16 @@
--}}
</dd>
{{/if}}
{{#if properties}}
<dt class="json-inner-schema">
{{~>json-schema/body $ref="" description=""}}
</dt>
{{/if}}
{{#if items}}
<dt class="json-inner-schema">
{{~>json-schema/body $ref="" description=""}}
</dt>
{{/if}}
{{/each}}
</dl>
</section>

2061
test/fixtures/issue-98.json vendored Normal file

File diff suppressed because it is too large Load Diff

23
test/fixtures/issue-98.yml vendored Normal file
View File

@ -0,0 +1,23 @@
swagger: '2.0'
info:
description: https://github.com/sourcey/spectacle/issues/98
title: issue 98
definitions:
Challenges:
type: object
properties:
total:
description: Total number of challenges
type: integer
completed:
description: Number of challenges completed by participant
type: integer
paths:
/challenges:
get:
description: 'issue 98'
responses:
'200':
description: OK
schema:
$ref: '#/definitions/Challenges'