Skip to content

Commit 49daaf6

Browse files
committed
feat: Add type+format mappings for go
We now register type+format mappings for the go generator so that types like integer with format uint64 get mapped correctly.
1 parent 4c08ff8 commit 49daaf6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java

+18
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,27 @@ public AbstractGoCodegen() {
117117
instantiationTypes.put("map", "GoMap");*/
118118

119119
typeMapping.clear();
120+
typeMapping.put("integer+int8", "int8");
121+
typeMapping.put("integer+uint8", "uint8");
122+
typeMapping.put("integer+int16", "int16");
123+
typeMapping.put("integer+uint16", "uint16");
120124
typeMapping.put("integer", "int32");
125+
typeMapping.put("integer+int32", "int32");
126+
typeMapping.put("integer+int64", "int64");
127+
typeMapping.put("integer+uint32", "uint32");
128+
typeMapping.put("integer+uint64", "uint64");
121129
typeMapping.put("long", "int64");
130+
typeMapping.put("number+int8", "int8");
131+
typeMapping.put("number+uint8", "uint8");
132+
typeMapping.put("number+int16", "int16");
133+
typeMapping.put("number+uint16", "uint16");
134+
typeMapping.put("number+int32", "int32");
135+
typeMapping.put("number+int64", "int64");
136+
typeMapping.put("number+uint32", "uint32");
137+
typeMapping.put("number+uint64", "uint64");
122138
typeMapping.put("number", "float32");
139+
typeMapping.put("number+float32", "float32");
140+
typeMapping.put("number+float64", "float64");
123141
typeMapping.put("float", "float32");
124142
typeMapping.put("double", "float64");
125143
typeMapping.put("decimal", "float64");

0 commit comments

Comments
 (0)