Response examples for inline objects are generated improperly
Swagger2Markup version: v1.3.3
Problem description: If an inline schema object is supplied in a response and examples are being generated for them, then the resulting response example will be "object". In addition, if the inline schema does not specify a type (e.g. type: object), then the attempt to generate a response example will NPE. Previous versions of the swagger-parser used to default an unspecified type to be "object" and now they are typed as "untyped".
Given this yaml input::
---
swagger: '2.0'
info:
version: 0.0.0
title: Simple API
tags:
- name: sample
paths:
/:
get:
tags:
- sample
responses:
200:
description: OK
schema:
type: object
properties:
id1:
type: integer
example: 1
id2:
$ref: '#/definitions/Id2'
string1:
type: string
example: string1
string2:
$ref: '#/definitions/String2'
definitions:
Id2:
type: integer
example: 2
String2:
type: string
example: string2
The resulting asciidoc is:
...
==== Example HTTP response
===== Response 200
[source,json]
----
"object"
----
Instead of the expected:
...
==== Example HTTP response
===== Response 200
[source,json]
----
{
"id1" : 1,
"id2" : 2,
"string1" : "string1",
"string2" : "string2"
}
----
Removing the line 'type: object' from the response schema will result in a NullPointerException.
Hi @kidnme, can i look at this issue #313 and try to solve it ?
Sure :)
ok :) can you also assinged it to me ? btw but not 314 that was mistake :/
Is this Issue already fixed ? @RobWin