Skip to content

Commit

Permalink
Revert "[PLAT-10456] Remove unreferenced definitions from swagger.jso…
Browse files Browse the repository at this point in the history
…n" and improve

Summary:
This reverts commit 3fd9edb.

Also mark nested structures related to userIntentOverrides as internal. Before this change, we were relying on PlatformSwaggerSpecFilter::isRemovingUnreferencedDefinitions() returning `true` to handle unreferenced definitions (like AZOverrides, UserIntentOverrides, etc.) and remove them from swagger.json. However, as pointed out in https://phorge.dev.yugabyte.com/D29019#inline-295684, this setting seems too aggressive in removing certain swagger definitions that we want to retain. So reverting that setting and manually marking definitions as internal instead.

Test Plan: swaggerGen

Reviewers: amalyshev, anijhawan, dkumar, #yba-api-review, dshubin

Reviewed By: amalyshev, anijhawan, #yba-api-review, dshubin

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D29093
  • Loading branch information
subramanian-neelakantan committed Oct 11, 2023
1 parent bdda250 commit fe26a51
Show file tree
Hide file tree
Showing 4 changed files with 965 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.yugabyte.yw.models.common.YbaApi;
import com.yugabyte.yw.models.common.YbaApi.YbaApiVisibility;
import com.yugabyte.yw.models.helpers.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiModelProperty.AccessMode;
import java.io.File;
Expand Down Expand Up @@ -471,6 +472,7 @@ interface PerProcessOverrides<T> {
}

// TODO: We can migrate masterDeviceInfo, masterInstanceType here
@ApiModel(description = "YbaApi Internal: Used by YBM")
@Data
public static class OverridenDetails {
@ApiModelProperty private String instanceType;
Expand Down Expand Up @@ -504,12 +506,14 @@ public <T, P extends OverridenDetails> P mergeApply(T val, Function<T, P> extrac
}
}

@ApiModel(description = "YbaApi Internal: Used by YBM")
@Data
public static class AZOverrides extends OverridenDetails
implements PerProcessOverrides<OverridenDetails> {
@ApiModelProperty private Map<UniverseTaskBase.ServerType, OverridenDetails> perProcess;
}

@ApiModel(description = "YbaApi Internal: Used by YBM")
@Data
public static class UserIntentOverrides implements PerProcessOverrides<OverridenDetails> {
@ApiModelProperty private Map<UniverseTaskBase.ServerType, OverridenDetails> perProcess;
Expand Down
Loading

0 comments on commit fe26a51

Please sign in to comment.