Skip to content

Commit

Permalink
Fix #18039 - Fix incorrect @Schema implementations in Swagger annotat…
Browse files Browse the repository at this point in the history
…ions (#18040)
  • Loading branch information
sonika-shah authored Sep 29, 2024
1 parent 1b029d2 commit baa2781
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import org.openmetadata.schema.api.data.CreateAPIEndpoint;
import org.openmetadata.schema.api.data.RestoreEntity;
import org.openmetadata.schema.entity.data.APIEndpoint;
import org.openmetadata.schema.entity.data.Topic;
import org.openmetadata.schema.type.ChangeEvent;
import org.openmetadata.schema.type.EntityHistory;
import org.openmetadata.schema.type.Include;
Expand Down Expand Up @@ -370,17 +369,17 @@ public Response updateAPIEndpoint(
@PUT
@Operation(
operationId = "createOrUpdateAPIEndpoint",
summary = "Update topic",
summary = "Update API Endpoint",
description =
"Create a API Endpoint, it it does not exist or update an existing API Endpoint.",
responses = {
@ApiResponse(
responseCode = "200",
description = "The updated topic ",
description = "The updated api endpoint ",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Topic.class)))
schema = @Schema(implementation = APIEndpoint.class)))
})
public Response createOrUpdate(
@Context UriInfo uriInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import org.openmetadata.schema.api.data.CreateDatabase;
import org.openmetadata.schema.api.data.RestoreEntity;
import org.openmetadata.schema.entity.data.Database;
import org.openmetadata.schema.entity.data.Table;
import org.openmetadata.schema.type.ChangeEvent;
import org.openmetadata.schema.type.DatabaseProfilerConfig;
import org.openmetadata.schema.type.EntityHistory;
Expand Down Expand Up @@ -566,15 +565,15 @@ public Response restoreDatabase(
@Operation(
operationId = "addDataProfilerConfig",
summary = "Add database profile config",
description = "Add database profile config to the table.",
description = "Add database profile config to the database.",
responses = {
@ApiResponse(
responseCode = "200",
description = "Successfully updated the Database ",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Table.class)))
schema = @Schema(implementation = Database.class)))
})
public Database addDataProfilerConfig(
@Context UriInfo uriInfo,
Expand All @@ -595,15 +594,15 @@ public Database addDataProfilerConfig(
@Operation(
operationId = "getDataProfilerConfig",
summary = "Get database profile config",
description = "Get database profile config to the table.",
description = "Get database profile config to the database.",
responses = {
@ApiResponse(
responseCode = "200",
description = "Successfully updated the Database ",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Table.class)))
schema = @Schema(implementation = Database.class)))
})
public Database getDataProfilerConfig(
@Context UriInfo uriInfo,
Expand Down Expand Up @@ -633,7 +632,7 @@ public Database getDataProfilerConfig(
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Table.class)))
schema = @Schema(implementation = Database.class)))
})
public Database deleteDataProfilerConfig(
@Context UriInfo uriInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.openmetadata.schema.api.VoteRequest;
import org.openmetadata.schema.api.data.CreateStoredProcedure;
import org.openmetadata.schema.api.data.RestoreEntity;
import org.openmetadata.schema.entity.data.DatabaseSchema;
import org.openmetadata.schema.entity.data.StoredProcedure;
import org.openmetadata.schema.type.ChangeEvent;
import org.openmetadata.schema.type.EntityHistory;
Expand Down Expand Up @@ -511,18 +510,18 @@ public Response delete(
@Path("/restore")
@Operation(
operationId = "restore",
summary = "Restore a soft deleted database schema.",
description = "Restore a soft deleted database schema.",
summary = "Restore a soft deleted stored procedure.",
description = "Restore a soft deleted stored procedure.",
responses = {
@ApiResponse(
responseCode = "200",
description = "Successfully restored the DatabaseSchema ",
description = "Successfully restored the StoredProcedure ",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = DatabaseSchema.class)))
schema = @Schema(implementation = StoredProcedure.class)))
})
public Response restoreDatabaseSchema(
public Response restoreStoredProcedure(
@Context UriInfo uriInfo,
@Context SecurityContext securityContext,
@Valid RestoreEntity restore) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,10 @@ public ResultList<GlossaryTerm> list(
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Glossary.class))),
@ApiResponse(responseCode = "404", description = "Glossary for instance {id} is not found")
schema = @Schema(implementation = GlossaryTerm.class))),
@ApiResponse(
responseCode = "404",
description = "Glossary term for instance {id} is not found")
})
public GlossaryTerm get(
@Context UriInfo uriInfo,
Expand Down Expand Up @@ -307,8 +309,10 @@ public GlossaryTerm get(
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Glossary.class))),
@ApiResponse(responseCode = "404", description = "Glossary for instance {fqn} is not found")
schema = @Schema(implementation = GlossaryTerm.class))),
@ApiResponse(
responseCode = "404",
description = "Glossary term for instance {fqn} is not found")
})
public GlossaryTerm getByName(
@Context UriInfo uriInfo,
Expand Down Expand Up @@ -365,14 +369,14 @@ public EntityHistory listVersions(
responses = {
@ApiResponse(
responseCode = "200",
description = "glossaries",
description = "The glossary term",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Glossary.class))),
schema = @Schema(implementation = GlossaryTerm.class))),
@ApiResponse(
responseCode = "404",
description = "Glossary for instance {id} and version {version} is not found")
description = "Glossary term for instance {id} and version {version} is not found")
})
public GlossaryTerm getVersion(
@Context UriInfo uriInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
import org.openmetadata.service.limits.Limits;
import org.openmetadata.service.resources.Collection;
import org.openmetadata.service.resources.EntityResource;
import org.openmetadata.service.resources.dqtests.TestCaseResource;
import org.openmetadata.service.security.Authorizer;
import org.openmetadata.service.security.policyevaluator.OperationContext;
import org.openmetadata.service.util.ResultList;
Expand Down Expand Up @@ -444,7 +443,7 @@ public Response addPipelineStatus(
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = TestCaseResource.TestCaseList.class)))
schema = @Schema(implementation = PipelineResource.PipelineStatusList.class)))
})
public ResultList<PipelineStatus> list(
@Context UriInfo uriInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import org.openmetadata.schema.api.data.RestoreEntity;
import org.openmetadata.schema.api.services.CreateDashboardService;
import org.openmetadata.schema.entity.services.DashboardService;
import org.openmetadata.schema.entity.services.DatabaseService;
import org.openmetadata.schema.entity.services.ServiceType;
import org.openmetadata.schema.entity.services.connections.TestConnectionResult;
import org.openmetadata.schema.type.DashboardConnection;
Expand Down Expand Up @@ -226,7 +225,7 @@ public DashboardService getByName(
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = DatabaseService.class)))
schema = @Schema(implementation = DashboardService.class)))
})
public DashboardService addTestConnectionResult(
@Context UriInfo uriInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import javax.ws.rs.core.UriInfo;
import org.openmetadata.schema.api.data.RestoreEntity;
import org.openmetadata.schema.api.services.CreateMessagingService;
import org.openmetadata.schema.entity.services.DatabaseService;
import org.openmetadata.schema.entity.services.MessagingService;
import org.openmetadata.schema.entity.services.ServiceType;
import org.openmetadata.schema.entity.services.connections.TestConnectionResult;
Expand Down Expand Up @@ -232,7 +231,7 @@ public MessagingService getByName(
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = DatabaseService.class)))
schema = @Schema(implementation = MessagingService.class)))
})
public MessagingService addTestConnectionResult(
@Context UriInfo uriInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
import lombok.extern.slf4j.Slf4j;
import org.openmetadata.schema.api.data.RestoreEntity;
import org.openmetadata.schema.api.services.CreateMetadataService;
import org.openmetadata.schema.entity.data.Table;
import org.openmetadata.schema.entity.services.DatabaseService;
import org.openmetadata.schema.entity.services.MetadataConnection;
import org.openmetadata.schema.entity.services.MetadataService;
import org.openmetadata.schema.entity.services.ServiceType;
Expand Down Expand Up @@ -272,7 +270,7 @@ public MetadataService getByName(
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = DatabaseService.class)))
schema = @Schema(implementation = MetadataService.class)))
})
public MetadataService addTestConnectionResult(
@Context UriInfo uriInfo,
Expand Down Expand Up @@ -541,13 +539,13 @@ public Response delete(
responses = {
@ApiResponse(
responseCode = "200",
description = "Successfully restored the Table ",
description = "Successfully restored the MetadataService ",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Table.class)))
schema = @Schema(implementation = MetadataService.class)))
})
public Response restoreTable(
public Response restoreMetadataService(
@Context UriInfo uriInfo,
@Context SecurityContext securityContext,
@Valid RestoreEntity restore) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import javax.ws.rs.core.UriInfo;
import org.openmetadata.schema.api.data.RestoreEntity;
import org.openmetadata.schema.api.services.CreateMlModelService;
import org.openmetadata.schema.entity.services.DatabaseService;
import org.openmetadata.schema.entity.services.MlModelService;
import org.openmetadata.schema.entity.services.ServiceType;
import org.openmetadata.schema.entity.services.connections.TestConnectionResult;
Expand Down Expand Up @@ -245,7 +244,7 @@ public MlModelService getByName(
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = DatabaseService.class)))
schema = @Schema(implementation = MlModelService.class)))
})
public MlModelService addTestConnectionResult(
@Context UriInfo uriInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import javax.ws.rs.core.UriInfo;
import org.openmetadata.schema.api.data.RestoreEntity;
import org.openmetadata.schema.api.services.CreatePipelineService;
import org.openmetadata.schema.entity.services.DatabaseService;
import org.openmetadata.schema.entity.services.PipelineService;
import org.openmetadata.schema.entity.services.ServiceType;
import org.openmetadata.schema.entity.services.connections.TestConnectionResult;
Expand Down Expand Up @@ -246,7 +245,7 @@ public PipelineService getByName(
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = DatabaseService.class)))
schema = @Schema(implementation = PipelineService.class)))
})
public PipelineService addTestConnectionResult(
@Context UriInfo uriInfo,
Expand Down

0 comments on commit baa2781

Please sign in to comment.