Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2125,6 +2125,11 @@ protected String getPrimitiveType(Schema schema) {
// This is a datatype that contains a date and time, but no timezone
return "LocalDateTime";
}
if ("year-month".equals(schema.getFormat())) {
// Override for custom swagger format: year-month
// This is a datatype that contains a year and month, but no day
return "YearMonth";
}
return "string";
} else if (isFreeFormObject(schema)) {
// Note: the value of a free-form object cannot be an arbitrary type. Per OAS specification,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public PureCloudDotNetClientCodegen() {
typeMapping.put("date", "String" );
typeMapping.put("LocalDateTime", "DateTime?");
typeMapping.put("LocalTime", "DateTime?");
typeMapping.put("YearMonth", "String" );
typeMapping.put("Dictionary<string, Object>", "Object");
typeMapping.put("decimal", "double");
typeMapping.put("decimal?", "double?");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public PureCloudGoClientCodegen() {
// Mainly used for API types of Map<string, Object>, which are objects with additional properties of type object
typeMapping.put("object", "interface{}");
typeMapping.put("local-date-time", "time.Time");
typeMapping.put("year-month", "string");
apiDocTemplateFiles.put("api_json.mustache", ".json");
operationTemplateFiles.put("operation_example.mustache", "-example.txt");
// Add special reserved words
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public PureCloudJavaClientCodegen() {

// Custom mappings for swagger type -> java type
importMapping.put("LocalDateTime", "org.joda.time.LocalDateTime");
importMapping.put("YearMonth", "java.time.YearMonth");
importMapping.put("PagedResource", "com.mypurecloud.sdk.v2.PagedResource");
importMapping.put("ArrayNode", "com.fasterxml.jackson.databind.node.ArrayNode");
importMapping.put("LocalDate", "java.time.LocalDate");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public PureCloudJavaScriptClientCodegen() {
typeMapping.put("number", "Number");
typeMapping.put("DateTime", "Date");
typeMapping.put("LocalDateTime", "Date");
typeMapping.put("YearMonth", "Date");
typeMapping.put("date", "String");
typeMapping.put("long", "Number");
typeMapping.put("short", "Number");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public PureCloudSwift4ClientCodegen() {
// Custom mappings and overrides for swagger type -> swift type
typeMapping.put("object", "JSON");
typeMapping.put("LocalDateTime", "String");
typeMapping.put("YearMonth", "String");
typeMapping.put("URI", "String");
typeMapping.put("uri", "String");
typeMapping.put("Dictionary", "String:JSON");
Expand Down