forked from loafle/openapi-generator-original
fix warning in cref for list (#12096)
This commit is contained in:
parent
4374a63a4c
commit
4e82b74cd5
@ -19,6 +19,8 @@ package org.openapitools.codegen.languages;
|
|||||||
|
|
||||||
import com.google.common.collect.ImmutableMap;
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.samskivert.mustache.Mustache.Lambda;
|
import com.samskivert.mustache.Mustache.Lambda;
|
||||||
|
import com.samskivert.mustache.Mustache;
|
||||||
|
import com.samskivert.mustache.Template;
|
||||||
|
|
||||||
import io.swagger.v3.oas.models.media.ArraySchema;
|
import io.swagger.v3.oas.models.media.ArraySchema;
|
||||||
import io.swagger.v3.oas.models.media.Schema;
|
import io.swagger.v3.oas.models.media.Schema;
|
||||||
@ -36,6 +38,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.Writer;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
import static org.openapitools.codegen.utils.StringUtils.camelize;
|
||||||
@ -399,6 +402,18 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
|||||||
|
|
||||||
// This either updates additionalProperties with the above fixes, or sets the default if the option was not specified.
|
// This either updates additionalProperties with the above fixes, or sets the default if the option was not specified.
|
||||||
additionalProperties.put(CodegenConstants.INTERFACE_PREFIX, interfacePrefix);
|
additionalProperties.put(CodegenConstants.INTERFACE_PREFIX, interfacePrefix);
|
||||||
|
|
||||||
|
// add lambda for mustache templates
|
||||||
|
additionalProperties.put("lambdaCref", new Mustache.Lambda() {
|
||||||
|
@Override
|
||||||
|
public void execute(Template.Fragment fragment, Writer writer) throws IOException {
|
||||||
|
String content = fragment.execute();
|
||||||
|
content = content.trim().replace("<", "{");
|
||||||
|
content = content.replace(">", "}");
|
||||||
|
content = content.replace("{string}", "{String}");
|
||||||
|
writer.write(content);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
{{#anyOf}}
|
{{#anyOf}}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="{{classname}}" /> class
|
/// Initializes a new instance of the <see cref="{{classname}}" /> class
|
||||||
/// with the <see cref="{{{.}}}" /> class
|
/// with the <see cref="{{#lambdaCref}}{{{.}}}{{/lambdaCref}}" /> class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="actualInstance">An instance of {{{.}}}.</param>
|
/// <param name="actualInstance">An instance of {{{.}}}.</param>
|
||||||
public {{classname}}({{{.}}} actualInstance)
|
public {{classname}}({{{.}}} actualInstance)
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
{{^isNull}}
|
{{^isNull}}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="{{classname}}" /> class
|
/// Initializes a new instance of the <see cref="{{classname}}" /> class
|
||||||
/// with the <see cref="{{dataType}}" /> class
|
/// with the <see cref="{{#lambdaCref}}{{{dataType}}}{{/lambdaCref}}" /> class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="actualInstance">An instance of {{dataType}}.</param>
|
/// <param name="actualInstance">An instance of {{dataType}}.</param>
|
||||||
public {{classname}}({{{dataType}}} actualInstance)
|
public {{classname}}({{{dataType}}} actualInstance)
|
||||||
|
@ -72,7 +72,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class
|
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class
|
||||||
/// with the <see cref="List<string>" /> class
|
/// with the <see cref="List{String}" /> class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="actualInstance">An instance of List<string>.</param>
|
/// <param name="actualInstance">An instance of List<string>.</param>
|
||||||
public PolymorphicProperty(List<string> actualInstance)
|
public PolymorphicProperty(List<string> actualInstance)
|
||||||
|
@ -73,7 +73,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class
|
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class
|
||||||
/// with the <see cref="List<string>" /> class
|
/// with the <see cref="List{String}" /> class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="actualInstance">An instance of List<string>.</param>
|
/// <param name="actualInstance">An instance of List<string>.</param>
|
||||||
public PolymorphicProperty(List<string> actualInstance)
|
public PolymorphicProperty(List<string> actualInstance)
|
||||||
|
@ -72,7 +72,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class
|
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class
|
||||||
/// with the <see cref="List<string>" /> class
|
/// with the <see cref="List{String}" /> class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="actualInstance">An instance of List<string>.</param>
|
/// <param name="actualInstance">An instance of List<string>.</param>
|
||||||
public PolymorphicProperty(List<string> actualInstance)
|
public PolymorphicProperty(List<string> actualInstance)
|
||||||
|
@ -72,7 +72,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class
|
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class
|
||||||
/// with the <see cref="List<string>" /> class
|
/// with the <see cref="List{String}" /> class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="actualInstance">An instance of List<string>.</param>
|
/// <param name="actualInstance">An instance of List<string>.</param>
|
||||||
public PolymorphicProperty(List<string> actualInstance)
|
public PolymorphicProperty(List<string> actualInstance)
|
||||||
|
@ -72,7 +72,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class
|
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class
|
||||||
/// with the <see cref="List<string>" /> class
|
/// with the <see cref="List{String}" /> class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="actualInstance">An instance of List<string>.</param>
|
/// <param name="actualInstance">An instance of List<string>.</param>
|
||||||
public PolymorphicProperty(List<string> actualInstance)
|
public PolymorphicProperty(List<string> actualInstance)
|
||||||
|
@ -72,7 +72,7 @@ namespace Org.OpenAPITools.Model
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class
|
/// Initializes a new instance of the <see cref="PolymorphicProperty" /> class
|
||||||
/// with the <see cref="List<string>" /> class
|
/// with the <see cref="List{String}" /> class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="actualInstance">An instance of List<string>.</param>
|
/// <param name="actualInstance">An instance of List<string>.</param>
|
||||||
public PolymorphicProperty(List<string> actualInstance)
|
public PolymorphicProperty(List<string> actualInstance)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user