forked from loafle/openapi-generator-original
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 p.getDefault().toString();
|
||||||
}
|
}
|
||||||
return null;
|
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)) {
|
} else if (ModelUtils.isStringSchema(p)) {
|
||||||
if (p.getDefault() != null) {
|
if (p.getDefault() != null) {
|
||||||
String _default = (String) p.getDefault();
|
String _default = (String) p.getDefault();
|
||||||
|
@ -834,6 +834,10 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
|||||||
if (p.getDefault() != null) {
|
if (p.getDefault() != null) {
|
||||||
return p.getDefault().toString();
|
return p.getDefault().toString();
|
||||||
}
|
}
|
||||||
|
} else if (ModelUtils.isURISchema(p)) {
|
||||||
|
if (p.getDefault() != null) {
|
||||||
|
return "URI.create('" + p.getDefault() + "')";
|
||||||
|
}
|
||||||
} else if (ModelUtils.isStringSchema(p)) {
|
} else if (ModelUtils.isStringSchema(p)) {
|
||||||
if (p.getDefault() != null) {
|
if (p.getDefault() != null) {
|
||||||
return "'" + p.getDefault() + "'";
|
return "'" + p.getDefault() + "'";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user