Skip to content

Commit 709a6eb

Browse files
authored
Added "draftMutability" to the UI config (#5436)
1 parent 3eeed84 commit 709a6eb

File tree

5 files changed

+46
-1
lines changed

5 files changed

+46
-1
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public UserInterfaceConfig getUIConfig() {
9898
.deleteGroup(restConfig.isGroupDeletionEnabled())
9999
.deleteArtifact(restConfig.isArtifactDeletionEnabled())
100100
.deleteVersion(restConfig.isArtifactVersionDeletionEnabled())
101+
.draftMutability(restConfig.isArtifactVersionMutabilityEnabled())
101102
.settings("true".equals(uiConfig.featureSettings)).build())
102103
.build();
103104
}

app/src/test/java/io/apicurio/registry/noprofile/rest/v3/DraftContentTest.java

+9
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import io.apicurio.registry.rest.client.models.CreateVersion;
1111
import io.apicurio.registry.rest.client.models.ProblemDetails;
1212
import io.apicurio.registry.rest.client.models.RuleType;
13+
import io.apicurio.registry.rest.client.models.UserInterfaceConfig;
1314
import io.apicurio.registry.rest.client.models.VersionContent;
1415
import io.apicurio.registry.rest.client.models.VersionMetaData;
1516
import io.apicurio.registry.rest.client.models.VersionSearchResults;
@@ -460,4 +461,12 @@ public void testDraftVersionsInCoreV2() throws Exception {
460461
.get("/registry/v2/groups/{groupId}/artifacts/{artifactId}/versions/latest").then()
461462
.statusCode(200);
462463
}
464+
465+
@Test
466+
public void testUiConfig() throws Exception {
467+
UserInterfaceConfig config = clientV3.system().uiConfig().get();
468+
Assertions.assertNotNull(config);
469+
Assertions.assertTrue(config.getFeatures().getDraftMutability());
470+
}
471+
463472
}

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

+4
Original file line numberDiff line numberDiff line change
@@ -4821,6 +4821,10 @@
48214821
"deleteVersion": {
48224822
"description": "",
48234823
"type": "boolean"
4824+
},
4825+
"draftMutability": {
4826+
"description": "",
4827+
"type": "boolean"
48244828
}
48254829
},
48264830
"example": {

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": "6D428EDE13C8C05F3E9350ADBED7F44A1E6FFE2930A5F0EF8AF63340F89684254673F58AD88E237A968713F30D33CF09EB59BC3D3F08969CB79C3C4444A972C8",
2+
"descriptionHash": "760E2C412DC1229895C64DE9E5C64E93739B4734CB2A4444323019D1A22B4C081479F739A9C7372E3E87D335E577DDE222B8DF9D48DF05ED285DEA1D2C7F2729",
33
"descriptionLocation": "../../v3.json",
44
"lockFileVersion": "1.0.0",
55
"kiotaVersion": "1.19.1",

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

+31
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ type UserInterfaceConfigFeatures struct {
1515
deleteGroup *bool
1616
// The deleteVersion property
1717
deleteVersion *bool
18+
// The draftMutability property
19+
draftMutability *bool
1820
// The readOnly property
1921
readOnly *bool
2022
// The roleManagement property
@@ -66,6 +68,12 @@ func (m *UserInterfaceConfigFeatures) GetDeleteVersion() *bool {
6668
return m.deleteVersion
6769
}
6870

71+
// GetDraftMutability gets the draftMutability property value. The draftMutability property
72+
// returns a *bool when successful
73+
func (m *UserInterfaceConfigFeatures) GetDraftMutability() *bool {
74+
return m.draftMutability
75+
}
76+
6977
// GetFieldDeserializers the deserialization information for the current model
7078
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
7179
func (m *UserInterfaceConfigFeatures) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
@@ -110,6 +118,16 @@ func (m *UserInterfaceConfigFeatures) GetFieldDeserializers() map[string]func(i8
110118
}
111119
return nil
112120
}
121+
res["draftMutability"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
122+
val, err := n.GetBoolValue()
123+
if err != nil {
124+
return err
125+
}
126+
if val != nil {
127+
m.SetDraftMutability(val)
128+
}
129+
return nil
130+
}
113131
res["readOnly"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
114132
val, err := n.GetBoolValue()
115133
if err != nil {
@@ -187,6 +205,12 @@ func (m *UserInterfaceConfigFeatures) Serialize(writer i878a80d2330e89d26896388a
187205
return err
188206
}
189207
}
208+
{
209+
err := writer.WriteBoolValue("draftMutability", m.GetDraftMutability())
210+
if err != nil {
211+
return err
212+
}
213+
}
190214
{
191215
err := writer.WriteBoolValue("readOnly", m.GetReadOnly())
192216
if err != nil {
@@ -239,6 +263,11 @@ func (m *UserInterfaceConfigFeatures) SetDeleteVersion(value *bool) {
239263
m.deleteVersion = value
240264
}
241265

266+
// SetDraftMutability sets the draftMutability property value. The draftMutability property
267+
func (m *UserInterfaceConfigFeatures) SetDraftMutability(value *bool) {
268+
m.draftMutability = value
269+
}
270+
242271
// SetReadOnly sets the readOnly property value. The readOnly property
243272
func (m *UserInterfaceConfigFeatures) SetReadOnly(value *bool) {
244273
m.readOnly = value
@@ -261,13 +290,15 @@ type UserInterfaceConfigFeaturesable interface {
261290
GetDeleteArtifact() *bool
262291
GetDeleteGroup() *bool
263292
GetDeleteVersion() *bool
293+
GetDraftMutability() *bool
264294
GetReadOnly() *bool
265295
GetRoleManagement() *bool
266296
GetSettings() *bool
267297
SetBreadcrumbs(value *bool)
268298
SetDeleteArtifact(value *bool)
269299
SetDeleteGroup(value *bool)
270300
SetDeleteVersion(value *bool)
301+
SetDraftMutability(value *bool)
271302
SetReadOnly(value *bool)
272303
SetRoleManagement(value *bool)
273304
SetSettings(value *bool)

0 commit comments

Comments
 (0)