Skip to content

Commit 408f1d7

Browse files
committed
Change the return value of replace-branch-versions to be more consistent
1 parent 7b2bc82 commit 408f1d7

File tree

4 files changed

+8
-25
lines changed

4 files changed

+8
-25
lines changed

app/src/main/java/io/apicurio/registry/rest/v3/GroupsResourceImpl.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ public VersionSearchResults listBranchVersions(String groupId, String artifactId
916916
@Override
917917
@Audited(extractParameters = {"0", KEY_GROUP_ID, "1", KEY_ARTIFACT_ID})
918918
@Authorized(style = AuthorizedStyle.GroupAndArtifact, level = AuthorizedLevel.Write)
919-
public List<String> replaceBranchVersions(String groupId, String artifactId, String branchId, ReplaceBranchVersions data) {
919+
public void replaceBranchVersions(String groupId, String artifactId, String branchId, ReplaceBranchVersions data) {
920920
requireParameter("groupId", groupId);
921921
requireParameter("artifactId", artifactId);
922922
requireParameter("branchId", branchId);
@@ -929,7 +929,6 @@ public List<String> replaceBranchVersions(String groupId, String artifactId, Str
929929
storage.getBranchMetaData(ga, bid);
930930

931931
storage.replaceBranchVersions(ga, bid, data.getVersions().stream().map(VersionId::new).toList());
932-
return data.getVersions();
933932
}
934933

935934
@Override

common/src/main/resources/META-INF/openapi.json

+1-11
Original file line numberDiff line numberDiff line change
@@ -3048,17 +3048,7 @@
30483048
"Branches"
30493049
],
30503050
"responses": {
3051-
"200": {
3052-
"content": {
3053-
"application/json": {
3054-
"schema": {
3055-
"type": "array",
3056-
"items": {
3057-
"$ref": "#/components/schemas/Version"
3058-
}
3059-
}
3060-
}
3061-
},
3051+
"204": {
30623052
"description": "The list of versions was replaced successfully."
30633053
},
30643054
"404": {

go-sdk/pkg/registryclient-v3/groups/item_artifacts_item_branches_item_versions_request_builder.go

+5-11
Original file line numberDiff line numberDiff line change
@@ -99,26 +99,20 @@ func (m *ItemArtifactsItemBranchesItemVersionsRequestBuilder) Post(ctx context.C
9999
}
100100

101101
// Put add a new version to an artifact branch. Branch is created if it does not exist. Returns a list of version identifiers in the artifact branch, ordered from the latest (tip of the branch) to the oldest.This operation can fail for the following reasons:* No artifact with this `groupId` and `artifactId` exists (HTTP error `404`)* No branch with this `branchId` exists (HTTP error `404`)* A server error occurred (HTTP error `500`)
102-
func (m *ItemArtifactsItemBranchesItemVersionsRequestBuilder) Put(ctx context.Context, body i00eb2e63d156923d00d8e86fe16b5d74daf30e363c9f185a8165cb42aa2f2c71.ReplaceBranchVersionsable, requestConfiguration *ItemArtifactsItemBranchesItemVersionsRequestBuilderPutRequestConfiguration) ([]string, error) {
102+
func (m *ItemArtifactsItemBranchesItemVersionsRequestBuilder) Put(ctx context.Context, body i00eb2e63d156923d00d8e86fe16b5d74daf30e363c9f185a8165cb42aa2f2c71.ReplaceBranchVersionsable, requestConfiguration *ItemArtifactsItemBranchesItemVersionsRequestBuilderPutRequestConfiguration) error {
103103
requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration)
104104
if err != nil {
105-
return nil, err
105+
return err
106106
}
107107
errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings{
108108
"404": i00eb2e63d156923d00d8e86fe16b5d74daf30e363c9f185a8165cb42aa2f2c71.CreateErrorFromDiscriminatorValue,
109109
"500": i00eb2e63d156923d00d8e86fe16b5d74daf30e363c9f185a8165cb42aa2f2c71.CreateErrorFromDiscriminatorValue,
110110
}
111-
res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitiveCollection(ctx, requestInfo, "string", errorMapping)
111+
err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping)
112112
if err != nil {
113-
return nil, err
114-
}
115-
val := make([]string, len(res))
116-
for i, v := range res {
117-
if v != nil {
118-
val[i] = *(v.(*string))
119-
}
113+
return err
120114
}
121-
return val, nil
115+
return nil
122116
}
123117

124118
// ToGetRequestInformation get a list of all versions in the branch. Returns a list of version identifiers in the branch, ordered from the latest (tip of the branch) to the oldest.This operation can fail for the following reasons:* No artifact with this `groupId` and `artifactId` exists (HTTP error `404`)* No branch with this `branchId` exists (HTTP error `404`)* A server error occurred (HTTP error `500`)

go-sdk/pkg/registryclient-v3/kiota-lock.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"descriptionHash": "344F39276758E3CA8971963C90DE0ABFE6B0AFCA167B697352C6D2ADB8169B7B9074D1131C064A29C40DA6929275DFBD069D9349C9886E90AD5A62AD2538A18B",
2+
"descriptionHash": "165CB28362B12D7C5F9A8CA280FCC90F78811CB61857DB9467AF62D3973806A641B4EA8F5E66ABE71FBDA60E9BEE143C833AF373D82FA39AD461505AC5C40608",
33
"descriptionLocation": "../../v3.json",
44
"lockFileVersion": "1.0.0",
55
"kiotaVersion": "1.10.1",

0 commit comments

Comments
 (0)