Skip to content

Commit 94654a0

Browse files
committed
Fix registry loader
1 parent 2c62f7e commit 94654a0

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

examples/rest-client/src/main/java/io/apicurio/registry/examples/RegistryLoader.java

+11-4
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818

1919
import io.apicurio.registry.client.auth.VertXAuthFactory;
2020
import io.apicurio.registry.rest.client.RegistryClient;
21-
import io.apicurio.registry.rest.client.models.ArtifactContent;
21+
import io.apicurio.registry.rest.client.models.CreateArtifact;
22+
import io.apicurio.registry.rest.client.models.CreateVersion;
2223
import io.apicurio.registry.rest.client.models.Rule;
2324
import io.apicurio.registry.rest.client.models.RuleType;
25+
import io.apicurio.registry.rest.client.models.VersionContent;
2426
import io.kiota.http.vertx.VertXRequestAdapter;
2527

2628
import java.util.UUID;
@@ -70,9 +72,14 @@ public void run() {
7072
for (int idx = 0; idx < numArtifacts; idx++) {
7173
System.out.println("Iteration: " + idx);
7274
String artifactId = UUID.randomUUID().toString();
73-
ArtifactContent content = new ArtifactContent();
74-
content.setContent(simpleAvro.replace("userInfo", "userInfo" + threadId + numArtifacts));
75-
client.groups().byGroupId("default").artifacts().post(content, config -> {
75+
CreateArtifact createArtifact = new CreateArtifact();
76+
createArtifact.setArtifactId("city");
77+
createArtifact.setType("JSON");
78+
createArtifact.setFirstVersion(new CreateVersion());
79+
createArtifact.getFirstVersion().setContent(new VersionContent());
80+
createArtifact.getFirstVersion().getContent().setContent(simpleAvro.replace("userInfo", "userInfo" + threadId + numArtifacts));
81+
createArtifact.getFirstVersion().getContent().setContentType("application/json");
82+
client.groups().byGroupId("default").artifacts().post(createArtifact, config -> {
7683
config.headers.add("X-Registry-ArtifactId", artifactId);
7784
});
7885
Rule rule = new Rule();

0 commit comments

Comments
 (0)