Skip to content

Commit

Permalink
[PLAT-14524] Undo all @JsonProperty annotations added earlier to fix …
Browse files Browse the repository at this point in the history
…APIs

Summary:
As part of https://phorge.dev.yugabyte.com/D36239 Jackson version for swagger gen was changes to match app jackson version.
This caused swagger definitions to change.
To fix that, few @JsonProperty annotations were added.
However, it seems like swagger definitions were just invalid comparing to actual APIs.
So, reverted all the added annotations as part of this diff.

Test Plan: itests

Reviewers: nsingh, #yba-api-review!

Reviewed By: nsingh

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D37146
  • Loading branch information
anmalysh-yb committed Aug 8, 2024
1 parent bd4874b commit edd8e3f
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package com.yugabyte.yw.forms;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.yugabyte.yw.common.Util;
import com.yugabyte.yw.common.backuprestore.BackupUtil;
import com.yugabyte.yw.models.Backup.StorageConfigType;
Expand Down Expand Up @@ -341,12 +340,10 @@ public List<String> getTableNameList() {
return new ArrayList<String>();
}

@JsonProperty("isFullBackup")
public boolean isFullBackup() {
return isFullBackup;
}

@JsonProperty("isFullBackup")
public void setFullBackup(boolean isFullBackup) {
this.isFullBackup = isFullBackup;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

package com.yugabyte.yw.forms;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.yugabyte.yw.commissioner.tasks.UniverseTaskBase;
import com.yugabyte.yw.metrics.MetricSettings;
import com.yugabyte.yw.models.common.YbaApi;
Expand Down Expand Up @@ -68,7 +67,6 @@ public class MetricQueryParams {

@ApiModelProperty(value = "YbaApi Internal. Is Recharts")
@YbaApi(visibility = YbaApiVisibility.INTERNAL, sinceYBAVersion = "2.14.0.0")
@JsonProperty("isRecharts")
private boolean isRecharts;

@ApiModelProperty(value = "YbaApi Internal. List of metrics with custom settings")
Expand Down
4 changes: 0 additions & 4 deletions managed/src/main/java/com/yugabyte/yw/models/BackupResp.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.yugabyte.yw.models;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.yugabyte.yw.models.Backup.BackupCategory;
import com.yugabyte.yw.models.Backup.BackupState;
import com.yugabyte.yw.models.Backup.StorageConfigType;
Expand Down Expand Up @@ -37,10 +36,7 @@ public class BackupResp {
Boolean onDemand;
StorageConfigType storageConfigType;
BackupCategory category;

@JsonProperty("isFullBackup")
Boolean isFullBackup;

TableType backupType;
CommonBackupInfo commonBackupInfo;
String scheduleName;
Expand Down
4 changes: 4 additions & 0 deletions managed/src/main/java/com/yugabyte/yw/models/Schedule.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import com.cronutils.model.time.ExecutionTime;
import com.cronutils.parser.CronParser;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
Expand Down Expand Up @@ -165,6 +167,8 @@ public SortByIF getOrderField() {
@Column(nullable = false)
private UUID customerUUID;

@JsonProperty
@JsonIgnore
public void setCustomerUUID(UUID customerUUID) {
this.customerUUID = customerUUID;
ObjectNode scheduleTaskParams = (ObjectNode) getTaskParams();
Expand Down
2 changes: 0 additions & 2 deletions managed/src/main/java/com/yugabyte/yw/models/Users.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.yugabyte.yw.common.PlatformServiceException;
import com.yugabyte.yw.common.concurrent.KeyLock;
import com.yugabyte.yw.common.encryption.HashBuilder;
Expand Down Expand Up @@ -173,7 +172,6 @@ public void setPassword(String password) {
private Role role;

@ApiModelProperty(value = "True if the user is the primary user")
@JsonProperty("isPrimary")
private boolean isPrimary;

@ApiModelProperty(value = "User Type")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ public class NodeConfig {
@ApiModel(description = "Validation result of a node config")
public static class ValidationResult {
private Type type;

private boolean valid;
private boolean required;

private String description;
private String value;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.yugabyte.yw.models.helpers.provider;

import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.yugabyte.yw.common.CloudProviderHelper.EditableInUseProvider;
import com.yugabyte.yw.models.common.YbaApi;
import com.yugabyte.yw.models.common.YbaApi.YbaApiVisibility;
Expand Down Expand Up @@ -77,7 +80,6 @@ public class KubernetesInfo implements CloudInfoInterface {
private String kubernetesPullSecretName;

@ApiModelProperty(accessMode = AccessMode.READ_ONLY)
@JsonProperty("isKubernetesOperatorControlled")
public boolean isKubernetesOperatorControlled = false;

// Flag for identifying the legacy k8s providers created before release 2.18.
Expand Down
50 changes: 29 additions & 21 deletions managed/src/main/resources/swagger-strict.json
Original file line number Diff line number Diff line change
Expand Up @@ -2429,7 +2429,6 @@
"type" : "boolean"
},
"isFullBackup" : {
"readOnly" : true,
"type" : "boolean"
},
"isStorageConfigPresent" : {
Expand Down Expand Up @@ -2473,7 +2472,7 @@
"type" : "boolean"
}
},
"required" : [ "backupType", "category", "commonBackupInfo", "customerUUID", "expiryTimeUnit", "fullChainSizeInBytes", "hasIncrementalBackups", "isStorageConfigPresent", "isUniversePresent", "lastBackupState", "onDemand", "scheduleName", "scheduleUUID", "storageConfigType", "universeName", "universeUUID", "useTablespaces" ],
"required" : [ "backupType", "category", "commonBackupInfo", "customerUUID", "expiryTimeUnit", "fullChainSizeInBytes", "hasIncrementalBackups", "isFullBackup", "isStorageConfigPresent", "isUniversePresent", "lastBackupState", "onDemand", "scheduleName", "scheduleUUID", "storageConfigType", "universeName", "universeUUID", "useTablespaces" ],
"type" : "object"
},
"BackupScheduleEditParams" : {
Expand Down Expand Up @@ -2670,6 +2669,9 @@
"$ref" : "#/definitions/ExtraDependencies",
"description" : "Extra dependencies"
},
"fullBackup" : {
"type" : "boolean"
},
"fullChainSizeInBytes" : {
"description" : "Incremental backups chain size",
"format" : "int64",
Expand Down Expand Up @@ -2873,7 +2875,7 @@
"type" : "string"
}
},
"required" : [ "creatingUser", "platformUrl", "platformVersion", "sleepAfterMasterRestartMillis", "sleepAfterTServerRestartMillis", "storageConfigUUID", "timeTakenPartial" ],
"required" : [ "creatingUser", "fullBackup", "platformUrl", "platformVersion", "sleepAfterMasterRestartMillis", "sleepAfterTServerRestartMillis", "storageConfigUUID", "timeTakenPartial" ],
"type" : "object"
},
"Basic Auth information" : {
Expand Down Expand Up @@ -6485,6 +6487,9 @@
"kubernetesImageRegistry" : {
"type" : "string"
},
"kubernetesOperatorControlled" : {
"type" : "boolean"
},
"kubernetesProvider" : {
"type" : "string"
},
Expand All @@ -6502,6 +6507,7 @@
"type" : "string"
}
},
"required" : [ "kubernetesOperatorControlled" ],
"type" : "object"
},
"KubernetesOverrideError" : {
Expand Down Expand Up @@ -6806,6 +6812,9 @@
"kubernetesImageRegistry" : {
"type" : "string"
},
"kubernetesOperatorControlled" : {
"type" : "boolean"
},
"kubernetesProvider" : {
"type" : "string"
},
Expand All @@ -6826,6 +6835,7 @@
"type" : "string"
}
},
"required" : [ "kubernetesOperatorControlled" ],
"type" : "object"
},
"LdapDnToYbaRoleData" : {
Expand Down Expand Up @@ -7202,12 +7212,15 @@
"MetricQueryParams" : {
"description" : "Metrics request data",
"properties" : {
"recharts" : {
"type" : "boolean"
},
"xclusterConfigUuid" : {
"format" : "uuid",
"type" : "string"
}
},
"required" : [ "xclusterConfigUuid" ],
"required" : [ "recharts", "xclusterConfigUuid" ],
"type" : "object"
},
"MetricSettings" : {
Expand Down Expand Up @@ -7339,6 +7352,9 @@
"$ref" : "#/definitions/ExtraDependencies",
"description" : "Extra dependencies"
},
"fullBackup" : {
"type" : "boolean"
},
"fullChainSizeInBytes" : {
"description" : "Incremental backups chain size",
"format" : "int64",
Expand Down Expand Up @@ -7542,7 +7558,7 @@
"type" : "string"
}
},
"required" : [ "creatingUser", "platformUrl", "platformVersion", "sleepAfterMasterRestartMillis", "sleepAfterTServerRestartMillis", "storageConfigUUID", "timeTakenPartial" ],
"required" : [ "creatingUser", "fullBackup", "platformUrl", "platformVersion", "sleepAfterMasterRestartMillis", "sleepAfterTServerRestartMillis", "storageConfigUUID", "timeTakenPartial" ],
"type" : "object"
},
"NamespaceInfoResp" : {
Expand Down Expand Up @@ -11650,12 +11666,6 @@
"description" : "Cron expression for the schedule",
"type" : "string"
},
"customerUUID" : {
"description" : "Customer UUID",
"format" : "uuid",
"readOnly" : true,
"type" : "string"
},
"failureCount" : {
"description" : "Number of failed backup attempts",
"format" : "int32",
Expand Down Expand Up @@ -15300,10 +15310,6 @@
"example" : "username1@example.com",
"type" : "string"
},
"isPrimary" : {
"description" : "True if the user is the primary user",
"type" : "boolean"
},
"ldapSpecifiedRole" : {
"description" : "LDAP Specified Role",
"type" : "boolean"
Expand All @@ -15312,6 +15318,9 @@
"readOnly" : true,
"type" : "string"
},
"primary" : {
"type" : "boolean"
},
"role" : {
"description" : "User role",
"enum" : [ "ConnectOnly", "ReadOnly", "BackupAdmin", "Admin", "SuperAdmin" ],
Expand All @@ -15333,7 +15342,7 @@
"type" : "string"
}
},
"required" : [ "email" ],
"required" : [ "email", "primary" ],
"type" : "object"
},
"Users" : {
Expand Down Expand Up @@ -15364,10 +15373,6 @@
"example" : "username1@example.com",
"type" : "string"
},
"isPrimary" : {
"description" : "True if the user is the primary user",
"type" : "boolean"
},
"ldapSpecifiedRole" : {
"description" : "LDAP Specified Role",
"type" : "boolean"
Expand All @@ -15376,6 +15381,9 @@
"readOnly" : true,
"type" : "string"
},
"primary" : {
"type" : "boolean"
},
"role" : {
"description" : "User role",
"enum" : [ "ConnectOnly", "ReadOnly", "BackupAdmin", "Admin", "SuperAdmin" ],
Expand All @@ -15397,7 +15405,7 @@
"type" : "string"
}
},
"required" : [ "email" ],
"required" : [ "email", "primary" ],
"type" : "object"
},
"VMImageUpgradeParams" : {
Expand Down
Loading

0 comments on commit edd8e3f

Please sign in to comment.