forked from loafle/openapi-generator-original
fix NPE in get swagger type (#6462)
This commit is contained in:
parent
29bd1d92f2
commit
afb75d64d0
@ -555,6 +555,12 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
|||||||
public String getSwaggerType(Property p) {
|
public String getSwaggerType(Property p) {
|
||||||
String swaggerType = super.getSwaggerType(p);
|
String swaggerType = super.getSwaggerType(p);
|
||||||
String type;
|
String type;
|
||||||
|
|
||||||
|
if (swaggerType == null) {
|
||||||
|
swaggerType = ""; // set swagger type to empty string if null
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO avoid using toLowerCase as typeMapping should be case-sensitive
|
||||||
if (typeMapping.containsKey(swaggerType.toLowerCase())) {
|
if (typeMapping.containsKey(swaggerType.toLowerCase())) {
|
||||||
type = typeMapping.get(swaggerType.toLowerCase());
|
type = typeMapping.get(swaggerType.toLowerCase());
|
||||||
if (languageSpecificPrimitives.contains(type)) {
|
if (languageSpecificPrimitives.contains(type)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user