mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 19:08:52 +00:00
Added special handling for 'string' types with format 'uri' (OpenAPITools#3160) (#3161)
- implemented Kotlin - implemented Java Fixes OpenAPITools#3160
This commit is contained in:
parent
73966a0152
commit
3a1b29b90c
@ -784,6 +784,11 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
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();
|
||||
|
@ -834,6 +834,10 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
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() + "'";
|
||||
|
Loading…
Reference in New Issue
Block a user