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
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.24.0
7.27.0
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Bandwidth
- API version: 1.0.0
- Generator version: 7.24.0
- Generator version: 7.27.0

Bandwidth's Communication APIs

Expand Down
6 changes: 3 additions & 3 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10013,7 +10013,7 @@ components:
multiChannelError:
example:
links: []
data: "{}"
data: {}
errors:
- type: type
description: description
Expand Down Expand Up @@ -15243,7 +15243,7 @@ components:
lookupErrorResponse:
example:
links: []
data: "{}"
data: {}
errors:
- code: NO-MATCH
description: Example error description
Expand Down Expand Up @@ -17304,7 +17304,7 @@ components:
- href: https://api.bandwidth.com/v2/accounts/5500123/endpoints/e-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85
rel: self
method: GET
data: "{}"
data: {}
errors:
- id: 59512d87-7a92-4040-8e4a-78fb772019b9
type: resource.not_found
Expand Down
19 changes: 11 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ sourceSets {
main.java.srcDirs = ['src/main/java']
}

ext {
jakarta_annotation_version = "1.3.5"
}

if(hasProperty('target') && target == 'android') {

apply plugin: 'com.android.library'
Expand Down Expand Up @@ -83,8 +87,10 @@ if(hasProperty('target') && target == 'android') {
apply plugin: 'java'
apply plugin: 'maven-publish'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

publishing {
publications {
Expand All @@ -96,23 +102,20 @@ if(hasProperty('target') && target == 'android') {
}

task execute(type:JavaExec) {
main = System.getProperty('mainClass')
mainClass = System.getProperty('mainClass')
classpath = sourceSets.main.runtimeClasspath
}
}

ext {
jakarta_annotation_version = "1.3.5"
}

dependencies {
implementation "com.google.code.findbugs:jsr305:3.0.2"
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
implementation 'com.google.code.gson:gson:2.9.1'
implementation 'io.gsonfire:gson-fire:1.9.0'
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6'
implementation 'org.openapitools:jackson-databind-nullable:0.2.8'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.22'
implementation 'org.openapitools:jackson-databind-nullable:0.2.13'
implementation group: 'org.json', name: 'json', version: '20250517'
implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.18.0'
Expand Down
5 changes: 3 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ lazy val root = (project in file(".")).
organization := "com.bandwidth.sdk",
name := "bandwidth-sdk",
version := "1.0.0",
scalaVersion := "2.11.12",
scalaVersion := "2.13.18",
scalacOptions ++= Seq("-feature"),
compile / javacOptions ++= Seq("-Xlint:deprecation"),
Compile / packageDoc / publishArtifact := false,
Expand All @@ -15,7 +15,8 @@ lazy val root = (project in file(".")).
"com.google.code.gson" % "gson" % "2.9.1",
"org.apache.commons" % "commons-lang3" % "3.18.0",
"jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6",
"org.openapitools" % "jackson-databind-nullable" % "0.2.8",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.22",
"org.openapitools" % "jackson-databind-nullable" % "0.2.13",
"org.json" % "json" % "20250517",
"org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2",
"io.gsonfire" % "gson-fire" % "1.9.0" % "compile",
Expand Down
37 changes: 20 additions & 17 deletions custom_templates/build.gradle.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ sourceSets {
}

{{/sourceFolder}}
ext {
{{#swagger1AnnotationLibrary}}
swagger_annotations_version = "1.6.9"
{{/swagger1AnnotationLibrary}}
{{#swagger2AnnotationLibrary}}
swagger_annotations_version = "2.2.9"
{{/swagger2AnnotationLibrary}}
jakarta_annotation_version = "1.3.5"
{{#useBeanValidation}}
bean_validation_version = "2.0.2"
{{/useBeanValidation}}
}

if(hasProperty('target') && target == 'android') {

apply plugin: 'com.android.library'
Expand Down Expand Up @@ -87,8 +100,10 @@ if(hasProperty('target') && target == 'android') {
apply plugin: 'java'
apply plugin: 'maven-publish'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

publishing {
publications {
Expand All @@ -100,24 +115,11 @@ if(hasProperty('target') && target == 'android') {
}

task execute(type:JavaExec) {
main = System.getProperty('mainClass')
mainClass = System.getProperty('mainClass')
classpath = sourceSets.main.runtimeClasspath
}
}

ext {
{{#swagger1AnnotationLibrary}}
swagger_annotations_version = "1.6.9"
{{/swagger1AnnotationLibrary}}
{{#swagger2AnnotationLibrary}}
swagger_annotations_version = "2.2.9"
{{/swagger2AnnotationLibrary}}
jakarta_annotation_version = "1.3.5"
{{#useBeanValidation}}
bean_validation_version = "2.0.2"
{{/useBeanValidation}}
}

dependencies {
{{#swagger1AnnotationLibrary}}
implementation "io.swagger:swagger-annotations:$swagger_annotations_version"
Expand All @@ -131,8 +133,9 @@ dependencies {
implementation 'com.google.code.gson:gson:2.9.1'
implementation 'io.gsonfire:gson-fire:1.9.0'
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.22'
{{#openApiNullable}}
implementation 'org.openapitools:jackson-databind-nullable:0.2.8'
implementation 'org.openapitools:jackson-databind-nullable:0.2.13'
{{/openApiNullable}}
{{#withAWSV4Signature}}
implementation 'software.amazon.awssdk:auth:2.20.157'
Expand Down
5 changes: 3 additions & 2 deletions custom_templates/build.sbt.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ lazy val root = (project in file(".")).
organization := "{{groupId}}",
name := "{{artifactId}}",
version := "{{artifactVersion}}",
scalaVersion := "2.11.12",
scalaVersion := "2.13.18",
scalacOptions ++= Seq("-feature"),
compile / javacOptions ++= Seq("-Xlint:deprecation"),
Compile / packageDoc / publishArtifact := false,
Expand All @@ -15,8 +15,9 @@ lazy val root = (project in file(".")).
"com.google.code.gson" % "gson" % "2.9.1",
"org.apache.commons" % "commons-lang3" % "3.18.0",
"jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6",
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.22",
{{#openApiNullable}}
"org.openapitools" % "jackson-databind-nullable" % "0.2.8",
"org.openapitools" % "jackson-databind-nullable" % "0.2.13",
{{/openApiNullable}}
{{#withAWSV4Signature}}
"software.amazon.awssdk" % "auth" % "2.20.157",
Expand Down
57 changes: 56 additions & 1 deletion custom_templates/libraries/okhttp-gson/ApiClient.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,17 @@ public class ApiClient {
return this;
}

/**
* <p>Set LocalDateTimeFormat.</p>
*
* @param dateFormat a {@link java.time.format.DateTimeFormatter} object
* @return a {@link {{invokerPackage}}.ApiClient} object
*/
public ApiClient setLocalDateTimeFormat(DateTimeFormatter dateFormat) {
JSON.setLocalDateTimeFormat(dateFormat);
return this;
}

{{/jsr310}}
/**
* <p>Set LenientOnJson.</p>
Expand Down Expand Up @@ -962,6 +973,46 @@ public class ApiClient {
}
}

/**
* Format the given parameter object as an ASCII-safe JSON string.
*
* @param param Parameter
* @return JSON representation of the parameter
*/
public String parameterToJsonString(Object param) {
if (param == null) {
return "";
}
String json = JSON.serialize(param);
int firstUnsafe = -1;
for (int i = 0; i < json.length(); i++) {
if (json.charAt(i) >= 0x7f) {
firstUnsafe = i;
break;
}
}
if (firstUnsafe == -1) {
return json;
}

StringBuilder escaped = new StringBuilder(json.length());
escaped.append(json, 0, firstUnsafe);
for (int i = firstUnsafe; i < json.length(); i++) {
char c = json.charAt(i);
if (c >= 0x7f) {
escaped.append("\\u");
escaped.append(Character.forDigit((c >> 12) & 0xf, 16));
escaped.append(Character.forDigit((c >> 8) & 0xf, 16));
escaped.append(Character.forDigit((c >> 4) & 0xf, 16));
escaped.append(Character.forDigit(c & 0xf, 16));
} else {
escaped.append(c);
}
}

return escaped.toString();
}

/**
* Formats the specified query parameter to a list containing a single {@code Pair} object.
*
Expand Down Expand Up @@ -2004,7 +2055,11 @@ public class ApiClient {
}
break;
case "header":
headerParams.put(param.getName(), parameterToString(value));
if (param.getContent() != null && param.getContent().containsKey("application/json")) {
headerParams.put(param.getName(), parameterToJsonString(value));
} else {
headerParams.put(param.getName(), parameterToString(value));
}
break;
case "cookie":
cookieParams.put(param.getName(), parameterToString(value));
Expand Down
Loading