Skip to content

Commit 980c956

Browse files
Merge pull request #16 from RusticiSoftware/v3.0.1-release
Updated library to allow DELETE requests with a body
2 parents de80d63 + 55e0403 commit 980c956

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
SCORM Cloud Rest API
44
- API version: 2.0
5-
- Build date: 2022-11-09T17:35:58.398-06:00
5+
- Build date: 2023-04-03T17:42:11.759-05:00
66

77
REST API used for SCORM Cloud integrations.
88

@@ -42,7 +42,7 @@ Add this dependency to your project's POM:
4242
<dependency>
4343
<groupId>com.rusticisoftware.cloud.v2.client</groupId>
4444
<artifactId>scormcloud-api-v2-client</artifactId>
45-
<version>3.0.0</version>
45+
<version>3.0.1</version>
4646
<scope>compile</scope>
4747
</dependency>
4848
```
@@ -52,7 +52,7 @@ Add this dependency to your project's POM:
5252
Add this dependency to your project's build file:
5353

5454
```groovy
55-
compile "com.rusticisoftware.cloud.v2.client:scormcloud-api-v2-client:3.0.0"
55+
compile "com.rusticisoftware.cloud.v2.client:scormcloud-api-v2-client:3.0.1"
5656
```
5757

5858
#### Others
@@ -65,7 +65,7 @@ mvn clean package
6565

6666
Then manually install the following JARs:
6767

68-
* `target/scormcloud-api-v2-client-3.0.0.jar`
68+
* `target/scormcloud-api-v2-client-3.0.1.jar`
6969
* `target/lib/*.jar`
7070

7171
## Tips and Tricks

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'idea'
22
apply plugin: 'eclipse'
33

44
group = 'com.rusticisoftware.cloud.v2.client'
5-
version = '3.0.0'
5+
version = '3.0.1'
66

77
buildscript {
88
repositories {

build.sbt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
22
settings(
33
organization := "com.rusticisoftware.cloud.v2.client",
44
name := "scormcloud-api-v2-client",
5-
version := "3.0.0",
5+
version := "3.0.1",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<artifactId>scormcloud-api-v2-client</artifactId>
55
<packaging>jar</packaging>
66
<name>scormcloud-api-v2-client</name>
7-
<version>3.0.1-SNAPSHOT</version>
7+
<version>3.0.2-SNAPSHOT</version>
88
<url>https://rusticisoftware.com/products/scorm-cloud/api/</url>
99
<description>Swagger Generated Java Client for SCORM Cloud API v2</description>
1010
<scm>

src/main/java/com/rusticisoftware/cloud/v2/client/ApiClient.java

+8-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public ApiClient() {
7373
this.dateFormat = new RFC3339DateFormat();
7474

7575
// Set default User-Agent.
76-
setUserAgent("Swagger-Codegen/3.0.0/java");
76+
setUserAgent("Swagger-Codegen/3.0.1/java");
7777

7878
// Setup authentications (key: authentication name, value: authentication).
7979
authentications = new HashMap<String, Authentication>();
@@ -654,6 +654,12 @@ public <T> ApiResponse<T> invokeAPI(String path, String method, List<Pair> query
654654
}
655655
}
656656

657+
Entity<?> entity = serialize(body, formParams, contentType);
658+
659+
if ("DELETE".equals(method) && entity.getEntity() != null) {
660+
target.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
661+
}
662+
657663
Invocation.Builder invocationBuilder = target.request().accept(accept);
658664

659665
for (Entry<String, String> entry : headerParams.entrySet()) {
@@ -673,8 +679,6 @@ public <T> ApiResponse<T> invokeAPI(String path, String method, List<Pair> query
673679
}
674680
}
675681

676-
Entity<?> entity = serialize(body, formParams, contentType);
677-
678682
Response response = null;
679683

680684
try {
@@ -685,7 +689,7 @@ public <T> ApiResponse<T> invokeAPI(String path, String method, List<Pair> query
685689
} else if ("PUT".equals(method)) {
686690
response = invocationBuilder.put(entity);
687691
} else if ("DELETE".equals(method)) {
688-
response = invocationBuilder.delete();
692+
response = invocationBuilder.method("DELETE", entity);
689693
} else if ("PATCH".equals(method)) {
690694
response = invocationBuilder.method("PATCH", entity);
691695
} else if ("HEAD".equals(method)) {

0 commit comments

Comments
 (0)