forked from loafle/openapi-generator-original
Merge pull request #284 from martoe/699
[2.0 Spec] Implement Schema Object.example field
This commit is contained in:
commit
b7452fa8ee
@ -12,6 +12,8 @@ public class CodegenProperty {
|
|||||||
public Integer minLength;
|
public Integer minLength;
|
||||||
/** pattern validation for strings, see http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.2.3 */
|
/** pattern validation for strings, see http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.2.3 */
|
||||||
public String pattern;
|
public String pattern;
|
||||||
|
/** A free-form property to include an example of an instance for this schema. */
|
||||||
|
public String example;
|
||||||
|
|
||||||
public Double minimum, maximum, exclusiveMinimum, exclusiveMaximum;
|
public Double minimum, maximum, exclusiveMinimum, exclusiveMaximum;
|
||||||
public Boolean hasMore = null, required = null, secondaryParam = null;
|
public Boolean hasMore = null, required = null, secondaryParam = null;
|
||||||
|
@ -412,7 +412,7 @@ public class DefaultCodegen {
|
|||||||
property.description = p.getDescription();
|
property.description = p.getDescription();
|
||||||
property.getter = "get" + name.substring(0, 1).toUpperCase() + name.substring(1);
|
property.getter = "get" + name.substring(0, 1).toUpperCase() + name.substring(1);
|
||||||
property.setter = "set" + name.substring(0, 1).toUpperCase() + name.substring(1);
|
property.setter = "set" + name.substring(0, 1).toUpperCase() + name.substring(1);
|
||||||
|
property.example = p.getExample();
|
||||||
property.defaultValue = toDefaultValue(p);
|
property.defaultValue = toDefaultValue(p);
|
||||||
|
|
||||||
String type = getSwaggerType(p);
|
String type = getSwaggerType(p);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user