Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(UI config): Added "draftMutability" to the UI config #5436

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public UserInterfaceConfig getUIConfig() {
.deleteGroup(restConfig.isGroupDeletionEnabled())
.deleteArtifact(restConfig.isArtifactDeletionEnabled())
.deleteVersion(restConfig.isArtifactVersionDeletionEnabled())
.draftMutability(restConfig.isArtifactVersionMutabilityEnabled())
.settings("true".equals(uiConfig.featureSettings)).build())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import io.apicurio.registry.rest.client.models.CreateVersion;
import io.apicurio.registry.rest.client.models.ProblemDetails;
import io.apicurio.registry.rest.client.models.RuleType;
import io.apicurio.registry.rest.client.models.UserInterfaceConfig;
import io.apicurio.registry.rest.client.models.VersionContent;
import io.apicurio.registry.rest.client.models.VersionMetaData;
import io.apicurio.registry.rest.client.models.VersionSearchResults;
Expand Down Expand Up @@ -460,4 +461,12 @@ public void testDraftVersionsInCoreV2() throws Exception {
.get("/registry/v2/groups/{groupId}/artifacts/{artifactId}/versions/latest").then()
.statusCode(200);
}

@Test
public void testUiConfig() throws Exception {
UserInterfaceConfig config = clientV3.system().uiConfig().get();
Assertions.assertNotNull(config);
Assertions.assertTrue(config.getFeatures().getDraftMutability());
}

}
4 changes: 4 additions & 0 deletions common/src/main/resources/META-INF/openapi.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{

Check warning on line 1 in common/src/main/resources/META-INF/openapi.json

View workflow job for this annotation

GitHub Actions / Validate

oas3-api-servers

Check warning on line 1 in common/src/main/resources/META-INF/openapi.json

View workflow job for this annotation

GitHub Actions / Validate

rhoas-servers-config
"openapi": "3.0.3",
"info": {
"title": "Apicurio Registry API [v3]",
Expand All @@ -14,7 +14,7 @@
"url": "https://www.apache.org/licenses/LICENSE-2.0"
}
},
"paths": {

Check warning on line 17 in common/src/main/resources/META-INF/openapi.json

View workflow job for this annotation

GitHub Actions / Validate

oas3-valid-media-example "value" property type must be string

Check warning on line 17 in common/src/main/resources/META-INF/openapi.json

View workflow job for this annotation

GitHub Actions / Validate

oas3-valid-media-example "value" property must have required property "title"

Check warning on line 17 in common/src/main/resources/META-INF/openapi.json

View workflow job for this annotation

GitHub Actions / Validate

oas3-valid-schema-example "version" property type must be string

Check warning on line 17 in common/src/main/resources/META-INF/openapi.json

View workflow job for this annotation

GitHub Actions / Validate

oas3-valid-schema-example "example" property must match pattern "^[a-zA-Z0-9._\-+]{1,256}$"

Check warning on line 17 in common/src/main/resources/META-INF/openapi.json

View workflow job for this annotation

GitHub Actions / Validate

oas3-valid-schema-example "example" property must be equal to one of the allowed values: "OUTBOUND", "INBOUND". Did you mean "INBOUND"?

Check warning on line 17 in common/src/main/resources/META-INF/openapi.json

View workflow job for this annotation

GitHub Actions / Validate

oas3-valid-schema-example "content" property must have required property "contentType"

Check warning on line 17 in common/src/main/resources/META-INF/openapi.json

View workflow job for this annotation

GitHub Actions / Validate

oas3-valid-schema-example "example" property must have required property "title"

Check warning on line 17 in common/src/main/resources/META-INF/openapi.json

View workflow job for this annotation

GitHub Actions / Validate

oas3-valid-schema-example "createdOn" property must match format "date-time"
"/ids/globalIds/{globalId}": {
"summary": "Access artifact content utilizing an artifact version's globally unique identifier.",
"get": {
Expand Down Expand Up @@ -4821,6 +4821,10 @@
"deleteVersion": {
"description": "",
"type": "boolean"
},
"draftMutability": {
"description": "",
"type": "boolean"
}
},
"example": {
Expand Down
2 changes: 1 addition & 1 deletion go-sdk/pkg/registryclient-v3/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"descriptionHash": "6D428EDE13C8C05F3E9350ADBED7F44A1E6FFE2930A5F0EF8AF63340F89684254673F58AD88E237A968713F30D33CF09EB59BC3D3F08969CB79C3C4444A972C8",
"descriptionHash": "760E2C412DC1229895C64DE9E5C64E93739B4734CB2A4444323019D1A22B4C081479F739A9C7372E3E87D335E577DDE222B8DF9D48DF05ED285DEA1D2C7F2729",
"descriptionLocation": "../../v3.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.19.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ type UserInterfaceConfigFeatures struct {
deleteGroup *bool
// The deleteVersion property
deleteVersion *bool
// The draftMutability property
draftMutability *bool
// The readOnly property
readOnly *bool
// The roleManagement property
Expand Down Expand Up @@ -66,6 +68,12 @@ func (m *UserInterfaceConfigFeatures) GetDeleteVersion() *bool {
return m.deleteVersion
}

// GetDraftMutability gets the draftMutability property value. The draftMutability property
// returns a *bool when successful
func (m *UserInterfaceConfigFeatures) GetDraftMutability() *bool {
return m.draftMutability
}

// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *UserInterfaceConfigFeatures) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
Expand Down Expand Up @@ -110,6 +118,16 @@ func (m *UserInterfaceConfigFeatures) GetFieldDeserializers() map[string]func(i8
}
return nil
}
res["draftMutability"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetDraftMutability(val)
}
return nil
}
res["readOnly"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
Expand Down Expand Up @@ -187,6 +205,12 @@ func (m *UserInterfaceConfigFeatures) Serialize(writer i878a80d2330e89d26896388a
return err
}
}
{
err := writer.WriteBoolValue("draftMutability", m.GetDraftMutability())
if err != nil {
return err
}
}
{
err := writer.WriteBoolValue("readOnly", m.GetReadOnly())
if err != nil {
Expand Down Expand Up @@ -239,6 +263,11 @@ func (m *UserInterfaceConfigFeatures) SetDeleteVersion(value *bool) {
m.deleteVersion = value
}

// SetDraftMutability sets the draftMutability property value. The draftMutability property
func (m *UserInterfaceConfigFeatures) SetDraftMutability(value *bool) {
m.draftMutability = value
}

// SetReadOnly sets the readOnly property value. The readOnly property
func (m *UserInterfaceConfigFeatures) SetReadOnly(value *bool) {
m.readOnly = value
Expand All @@ -261,13 +290,15 @@ type UserInterfaceConfigFeaturesable interface {
GetDeleteArtifact() *bool
GetDeleteGroup() *bool
GetDeleteVersion() *bool
GetDraftMutability() *bool
GetReadOnly() *bool
GetRoleManagement() *bool
GetSettings() *bool
SetBreadcrumbs(value *bool)
SetDeleteArtifact(value *bool)
SetDeleteGroup(value *bool)
SetDeleteVersion(value *bool)
SetDraftMutability(value *bool)
SetReadOnly(value *bool)
SetRoleManagement(value *bool)
SetSettings(value *bool)
Expand Down
Loading