Skip to content

Commit

Permalink
Add wildcard content type (#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlesarnal authored Sep 15, 2020
1 parent 84fd7a3 commit bd6f6cf
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import io.apicurio.registry.client.service.RulesService;
import io.apicurio.registry.client.service.SearchService;
import okhttp3.Interceptor;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.RequestBody;
import retrofit2.Retrofit;
Expand Down Expand Up @@ -121,7 +122,7 @@ public List<String> listArtifacts() {
@Override
public ArtifactMetaData createArtifact(ArtifactType artifactType, String artifactId, IfExistsType ifExistsType, InputStream data) {

return requestHandler.execute(artifactsService.createArtifact(artifactType, artifactId, ifExistsType, RequestBody.create(null, IoUtil.toBytes(data))));
return requestHandler.execute(artifactsService.createArtifact(artifactType, artifactId, ifExistsType, RequestBody.create(MediaType.parse("*/*"), IoUtil.toBytes(data))));
}

@Override
Expand All @@ -134,7 +135,7 @@ public InputStream getLatestArtifact(String artifactId) {
public ArtifactMetaData updateArtifact(String artifactId,
ArtifactType xRegistryArtifactType, InputStream data) {

return requestHandler.execute(artifactsService.updateArtifact(artifactId, xRegistryArtifactType, RequestBody.create(null, IoUtil.toBytes(data))));
return requestHandler.execute(artifactsService.updateArtifact(artifactId, xRegistryArtifactType, RequestBody.create(MediaType.parse("*/*"), IoUtil.toBytes(data))));
}

@Override
Expand Down Expand Up @@ -165,7 +166,7 @@ public void updateArtifactMetaData(String artifactId, EditableMetaData data) {
public ArtifactMetaData getArtifactMetaDataByContent(String artifactId,
InputStream data) {

return requestHandler.execute(artifactsService.getArtifactMetaDataByContent(artifactId, RequestBody.create(null, IoUtil.toBytes(data))));
return requestHandler.execute(artifactsService.getArtifactMetaDataByContent(artifactId, RequestBody.create(MediaType.parse("*/*"), IoUtil.toBytes(data))));
}

@Override
Expand All @@ -178,7 +179,7 @@ public List<Long> listArtifactVersions(String artifactId) {
public VersionMetaData createArtifactVersion(String artifactId,
ArtifactType xRegistryArtifactType, InputStream data) {

return requestHandler.execute(artifactsService.createArtifactVersion(artifactId, xRegistryArtifactType, RequestBody.create(null, IoUtil.toBytes(data))));
return requestHandler.execute(artifactsService.createArtifactVersion(artifactId, xRegistryArtifactType, RequestBody.create(MediaType.parse("*/*"), IoUtil.toBytes(data))));
}

@Override
Expand Down Expand Up @@ -254,7 +255,7 @@ public void deleteArtifactRule(RuleType rule, String artifactId) {
public void testUpdateArtifact(String artifactId,
ArtifactType xRegistryArtifactType, InputStream data) {

requestHandler.execute(artifactsService.testUpdateArtifact(artifactId, xRegistryArtifactType, RequestBody.create(null, IoUtil.toBytes(data))));
requestHandler.execute(artifactsService.testUpdateArtifact(artifactId, xRegistryArtifactType, RequestBody.create(MediaType.parse("*/*"), IoUtil.toBytes(data))));
}

@Override
Expand Down

0 comments on commit bd6f6cf

Please sign in to comment.