Skip to content

Commit 6f8968e

Browse files
committed
Fix REST Api due to constructor issues on generated code
1 parent d1266af commit 6f8968e

File tree

6 files changed

+44
-82
lines changed

6 files changed

+44
-82
lines changed

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import io.apicurio.registry.rest.MissingRequiredParameterException;
1717
import io.apicurio.registry.rest.v3.beans.ArtifactTypeInfo;
1818
import io.apicurio.registry.rest.v3.beans.ConfigurationProperty;
19-
import io.apicurio.registry.rest.v3.beans.CreateSnapshot;
2019
import io.apicurio.registry.rest.v3.beans.DownloadRef;
2120
import io.apicurio.registry.rest.v3.beans.RoleMapping;
2221
import io.apicurio.registry.rest.v3.beans.RoleMappingSearchResults;
@@ -136,7 +135,7 @@ public List<ArtifactTypeInfo> listArtifactTypes() {
136135

137136
@Override
138137
@Authorized(style=AuthorizedStyle.None, level=AuthorizedLevel.Admin)
139-
public SnapshotMetaData triggerSnapshot(CreateSnapshot data) {
138+
public SnapshotMetaData triggerSnapshot() {
140139
storage.triggerSnapshotCreation();
141140
return SnapshotMetaData.builder().build();
142141
}

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

+9-16
Original file line numberDiff line numberDiff line change
@@ -2485,16 +2485,6 @@
24852485
"/admin/snapshots": {
24862486
"summary": "Triggers a snapshot of the Registry storage. Only supported in KafkaSQL storage",
24872487
"post": {
2488-
"requestBody": {
2489-
"content": {
2490-
"application/json": {
2491-
"schema": {
2492-
"$ref": "#/components/schemas/CreateSnapshot"
2493-
}
2494-
}
2495-
},
2496-
"required": true
2497-
},
24982488
"tags": [
24992489
"KafkaSQL",
25002490
"Admin",
@@ -4459,16 +4449,19 @@
44594449
],
44604450
"type": "string"
44614451
},
4462-
"CreateSnapshot": {
4463-
"title": "Root Type for CreateSnapshot",
4464-
"description": "",
4465-
"type": "object",
4466-
"example": {}
4467-
},
44684452
"SnapshotMetaData": {
44694453
"title": "Root Type for SnapshotMetaData",
44704454
"description": "",
4455+
"required": [
4456+
"snapshotId"
4457+
],
44714458
"type": "object",
4459+
"properties": {
4460+
"snapshotId": {
4461+
"description": "",
4462+
"type": "string"
4463+
}
4464+
},
44724465
"example": {}
44734466
}
44744467
},

go-sdk/pkg/registryclient-v3/admin/snapshots_request_builder.go

+3-7
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ func NewSnapshotsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee2633
3535
}
3636

3737
// Post triggers the creation of a snapshot of the internal database for compatible storages.This operation can fail for the following reasons:* A server error occurred (HTTP error `500`)
38-
func (m *SnapshotsRequestBuilder) Post(ctx context.Context, body i00eb2e63d156923d00d8e86fe16b5d74daf30e363c9f185a8165cb42aa2f2c71.CreateSnapshotable, requestConfiguration *SnapshotsRequestBuilderPostRequestConfiguration) (i00eb2e63d156923d00d8e86fe16b5d74daf30e363c9f185a8165cb42aa2f2c71.SnapshotMetaDataable, error) {
39-
requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration)
38+
func (m *SnapshotsRequestBuilder) Post(ctx context.Context, requestConfiguration *SnapshotsRequestBuilderPostRequestConfiguration) (i00eb2e63d156923d00d8e86fe16b5d74daf30e363c9f185a8165cb42aa2f2c71.SnapshotMetaDataable, error) {
39+
requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration)
4040
if err != nil {
4141
return nil, err
4242
}
@@ -54,17 +54,13 @@ func (m *SnapshotsRequestBuilder) Post(ctx context.Context, body i00eb2e63d15692
5454
}
5555

5656
// ToPostRequestInformation triggers the creation of a snapshot of the internal database for compatible storages.This operation can fail for the following reasons:* A server error occurred (HTTP error `500`)
57-
func (m *SnapshotsRequestBuilder) ToPostRequestInformation(ctx context.Context, body i00eb2e63d156923d00d8e86fe16b5d74daf30e363c9f185a8165cb42aa2f2c71.CreateSnapshotable, requestConfiguration *SnapshotsRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
57+
func (m *SnapshotsRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *SnapshotsRequestBuilderPostRequestConfiguration) (*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {
5858
requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters)
5959
if requestConfiguration != nil {
6060
requestInfo.Headers.AddAll(requestConfiguration.Headers)
6161
requestInfo.AddRequestOptions(requestConfiguration.Options)
6262
}
6363
requestInfo.Headers.TryAdd("Accept", "application/json")
64-
err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body)
65-
if err != nil {
66-
return nil, err
67-
}
6864
return requestInfo, nil
6965
}
7066

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": "CF9A2F8F158C264F6183EC94A353F2388FC54871FD9D08738624A94A1DC5F46F5F5DADAB954D585F0D6023A05F3D4E61A1B00CEB0BF629529F83B3D7CE468062",
2+
"descriptionHash": "529CE820489E3D80E20AD8B9FF580F48197ACE698CABD870E42CCAFD8C6B517851E02D68DBBBAA0DD52197FE9FB4F54B9F5B0FC7333425F8663304F20BECADAF",
33
"descriptionLocation": "../../v3.json",
44
"lockFileVersion": "1.0.0",
55
"kiotaVersion": "1.10.1",

go-sdk/pkg/registryclient-v3/models/create_snapshot.go

-56
This file was deleted.

go-sdk/pkg/registryclient-v3/models/snapshot_meta_data.go

+30
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
type SnapshotMetaData struct {
99
// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
1010
additionalData map[string]any
11+
// The snapshotId property
12+
snapshotId *string
1113
}
1214

1315
// NewSnapshotMetaData instantiates a new SnapshotMetaData and sets the default values.
@@ -30,11 +32,32 @@ func (m *SnapshotMetaData) GetAdditionalData() map[string]any {
3032
// GetFieldDeserializers the deserialization information for the current model
3133
func (m *SnapshotMetaData) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
3234
res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error)
35+
res["snapshotId"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
36+
val, err := n.GetStringValue()
37+
if err != nil {
38+
return err
39+
}
40+
if val != nil {
41+
m.SetSnapshotId(val)
42+
}
43+
return nil
44+
}
3345
return res
3446
}
3547

48+
// GetSnapshotId gets the snapshotId property value. The snapshotId property
49+
func (m *SnapshotMetaData) GetSnapshotId() *string {
50+
return m.snapshotId
51+
}
52+
3653
// Serialize serializes information the current object
3754
func (m *SnapshotMetaData) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter) error {
55+
{
56+
err := writer.WriteStringValue("snapshotId", m.GetSnapshotId())
57+
if err != nil {
58+
return err
59+
}
60+
}
3861
{
3962
err := writer.WriteAdditionalData(m.GetAdditionalData())
4063
if err != nil {
@@ -49,8 +72,15 @@ func (m *SnapshotMetaData) SetAdditionalData(value map[string]any) {
4972
m.additionalData = value
5073
}
5174

75+
// SetSnapshotId sets the snapshotId property value. The snapshotId property
76+
func (m *SnapshotMetaData) SetSnapshotId(value *string) {
77+
m.snapshotId = value
78+
}
79+
5280
// SnapshotMetaDataable
5381
type SnapshotMetaDataable interface {
5482
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder
5583
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
84+
GetSnapshotId() *string
85+
SetSnapshotId(value *string)
5686
}

0 commit comments

Comments
 (0)