Skip to content

Commit

Permalink
Fixed request body of PUTImport requests
Browse files Browse the repository at this point in the history
  • Loading branch information
computate committed Jan 5, 2024
1 parent 0cdd3e0 commit 865432f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/gen/java/org/computate/vertx/writer/ApiWriterGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.computate.vertx.writer;

import org.computate.vertx.request.ComputateSiteRequest;
import java.lang.Object;
import org.computate.vertx.api.ApiRequest;
import org.computate.vertx.config.ComputateConfigKeys;
import java.util.Optional;
Expand Down Expand Up @@ -44,7 +45,6 @@
import org.slf4j.LoggerFactory;
import java.math.RoundingMode;
import java.util.Map;
import java.lang.Object;
import org.computate.search.computate.enus.ComputateEnUSClass;
import org.computate.search.response.solr.SolrResponse.Doc;
import java.lang.Integer;
Expand Down Expand Up @@ -3501,7 +3501,6 @@ public static String staticSearchFqApiWriter(String entityVar, ComputateSiteRequ
}

public static final String CLASS_SIMPLE_NAME = "ApiWriter";
public static final String CLASS_API_ADDRESS = "computate-vertx-enUS-ApiWriter";
public static final String VAR_siteRequest_ = "siteRequest_";
public static final String VAR_classDoc = "classDoc";
public static final String VAR_classSolrDocument = "classSolrDocument";
Expand Down
10 changes: 9 additions & 1 deletion src/main/java/org/computate/vertx/writer/ApiWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ public void writeEntitySchema(Integer numberTabs) throws Exception, Exception {
}

public void writeEntitySchema(Integer numberTabs, AllWriter w, String apiRequestOrResponse) throws Exception, Exception {
numberTabs = numberTabs == null ? (classApiMethod.contains("Search") && "response".equals(apiRequestOrResponse) ? 3 : 0) : numberTabs;
numberTabs = numberTabs == null ? (classApiMethod.contains("Search") && "response".equals(apiRequestOrResponse) ? 3 : ("PUT".equals(classApiMethodMethod) ? 3 : 0)) : numberTabs;
if(entityJsonType != null) {

if("PATCH".equals(classApiMethodMethod)) {
Expand Down Expand Up @@ -788,6 +788,14 @@ public void writeApi(Boolean id) throws Exception, Exception {
}
wSchemas.tl(tabsSchema + 2, "- type: object");
wSchemas.tl(tabsSchema + 3, "properties:");
if("PUT".equals(classApiMethodMethod)) {
wSchemas.tl(tabsSchema + 4, "list:");
wSchemas.tl(tabsSchema + 5, "type: array");
wSchemas.tl(tabsSchema + 5, "items:");
wSchemas.tl(tabsSchema + 6, "type: object");
wSchemas.tl(tabsSchema + 6, "properties:");

}
wSchemas.s(wRequestSchema.toString());
}

Expand Down

0 comments on commit 865432f

Please sign in to comment.