Skip to content

Commit

Permalink
Added special handling for 'string' types with format 'uri' (OpenAPIT…
Browse files Browse the repository at this point in the history
…ools#3160) (OpenAPITools#3161)

- implemented Kotlin
- implemented Java

Fixes OpenAPITools#3160
  • Loading branch information
rainerh authored and wing328 committed Jun 28, 2019
1 parent 73966a0 commit 3a1b29b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,11 @@ public String toDefaultValue(Schema p) {
return p.getDefault().toString();
}
return null;
} else if (ModelUtils.isURISchema(p)) {
if (p.getDefault() != null) {
return "URI.create(\"" + escapeText((String) p.getDefault()) + "\")";
}
return null;
} else if (ModelUtils.isStringSchema(p)) {
if (p.getDefault() != null) {
String _default = (String) p.getDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,10 @@ public String toDefaultValue(Schema p) {
if (p.getDefault() != null) {
return p.getDefault().toString();
}
} else if (ModelUtils.isURISchema(p)) {
if (p.getDefault() != null) {
return "URI.create('" + p.getDefault() + "')";
}
} else if (ModelUtils.isStringSchema(p)) {
if (p.getDefault() != null) {
return "'" + p.getDefault() + "'";
Expand Down

0 comments on commit 3a1b29b

Please sign in to comment.