From 8ce574342d5f95f9aa74c7a849abc10f622b2982 Mon Sep 17 00:00:00 2001 From: mohitdeuex <105265192+mohitdeuex@users.noreply.github.com> Date: Tue, 24 May 2022 21:21:02 +0530 Subject: [PATCH] [BACKEND][BUG] Fix the issue between the Code and Generated Swagger Definition #4960 (#5120) --- .../catalog/resources/CatalogResource.java | 6 +- .../catalog/resources/bots/BotResource.java | 11 +- .../resources/charts/ChartResource.java | 15 +- .../resources/config/ConfigResource.java | 15 +- .../dashboards/DashboardResource.java | 17 +- .../resources/databases/DatabaseResource.java | 20 ++- .../databases/DatabaseSchemaResource.java | 16 +- .../resources/databases/TableResource.java | 164 ++++++++++++++++-- .../resources/events/EventResource.java | 4 +- .../resources/events/WebhookResource.java | 12 +- .../catalog/resources/feeds/FeedResource.java | 12 +- .../resources/glossary/GlossaryResource.java | 12 +- .../glossary/GlossaryTermResource.java | 26 ++- .../resources/lineage/LineageResource.java | 4 + .../resources/locations/LocationResource.java | 26 ++- .../resources/metrics/MetricsResource.java | 4 + .../resources/mlmodels/MlModelResource.java | 27 ++- .../permissions/PermissionsResource.java | 2 +- .../resources/pipelines/PipelineResource.java | 32 +++- .../resources/policies/PolicyResource.java | 11 +- .../resources/reports/ReportResource.java | 4 + .../resources/search/SearchResource.java | 4 +- .../resources/services/ServiceResource.java | 4 +- .../dashboard/DashboardServiceResource.java | 32 ++-- .../database/DatabaseServiceResource.java | 32 ++-- .../IngestionPipelineResource.java | 16 +- .../messaging/MessagingServiceResource.java | 32 ++-- .../pipeline/PipelineServiceResource.java | 32 ++-- .../storage/StorageServiceResource.java | 24 ++- .../catalog/resources/tags/TagResource.java | 24 ++- .../catalog/resources/teams/RoleResource.java | 13 +- .../catalog/resources/teams/TeamResource.java | 13 +- .../catalog/resources/teams/UserResource.java | 14 +- .../resources/topics/TopicResource.java | 39 ++++- .../catalog/resources/types/TypeResource.java | 11 +- .../resources/usage/UsageResource.java | 5 + .../resources/version/VersionResource.java | 3 +- 37 files changed, 581 insertions(+), 157 deletions(-) diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/CatalogResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/CatalogResource.java index 160ad886d60..e1ba7059b9c 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/CatalogResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/CatalogResource.java @@ -59,8 +59,9 @@ public class CatalogResource { @GET @Operation( + operationId = "listCollections", summary = "List all collections", - tags = "general", + tags = "catalog", description = "List all the collections supported by OpenMetadata. This list provides all the collections " + "and resource REST endpoints.", @@ -68,8 +69,7 @@ public class CatalogResource { @ApiResponse( responseCode = "200", description = "All collections", - content = - @Content(mediaType = "application/json", schema = @Schema(implementation = CollectionDescriptor.class))) + content = @Content(mediaType = "application/json", schema = @Schema(implementation = CollectionList.class))) }) public CollectionList getCollections(@Context UriInfo uriInfo) { return getCollectionList(uriInfo); diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/bots/BotResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/bots/BotResource.java index 144bcd0d248..5483ac21dc1 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/bots/BotResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/bots/BotResource.java @@ -90,6 +90,7 @@ public class BotResource extends EntityResource { @GET @Operation( + operationId = "listBots", summary = "List Bot", tags = "bots", description = "Get a list of Bot.", @@ -122,6 +123,7 @@ public class BotResource extends EntityResource { @GET @Path("/{id}") @Operation( + operationId = "getBotByID", summary = "Get a bot", tags = "bots", description = "Get a bot by `id`.", @@ -144,6 +146,7 @@ public class BotResource extends EntityResource { @GET @Path("/name/{fqn}") @Operation( + operationId = "getBotByFQN", summary = "Get a bot by name", tags = "bots", description = "Get a bot by name.", @@ -172,6 +175,7 @@ public class BotResource extends EntityResource { @GET @Path("/{id}/versions") @Operation( + operationId = "listAllBotVersion", summary = "List bot versions", tags = "bots", description = "Get a list of all the versions of a bot identified by `id`", @@ -192,6 +196,7 @@ public class BotResource extends EntityResource { @GET @Path("/{id}/versions/{version}") @Operation( + operationId = "listSpecificBotVersion", summary = "Get a version of the bot", tags = "bots", description = "Get a version of the bot by given `id`", @@ -219,6 +224,7 @@ public class BotResource extends EntityResource { @POST @Operation( + operationId = "createBot", summary = "Create a bot", tags = "bots", description = "Create a new bot.", @@ -237,6 +243,7 @@ public class BotResource extends EntityResource { @PUT @Operation( + operationId = "createOrUpdateBot", summary = "Create or update a bot", tags = "bots", description = "Create a bot, if it does not exist. If a bot already exists, update the bot.", @@ -244,7 +251,7 @@ public class BotResource extends EntityResource { @ApiResponse( responseCode = "200", description = "The bot", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreateBot.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Bot.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response createOrUpdate( @@ -256,6 +263,7 @@ public class BotResource extends EntityResource { @PATCH @Path("/{id}") @Operation( + operationId = "patchBot", summary = "Update a bot", tags = "bots", description = "Update an existing bot using JsonPatch.", @@ -281,6 +289,7 @@ public class BotResource extends EntityResource { @DELETE @Path("/{id}") @Operation( + operationId = "deleteBot", summary = "Delete a bot", tags = "bots", description = "Delete a bot by `id`. Bot is not immediately deleted and is only marked as deleted.", diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/charts/ChartResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/charts/ChartResource.java index 8077eea9eba..e7f565ea4f4 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/charts/ChartResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/charts/ChartResource.java @@ -99,6 +99,7 @@ public class ChartResource extends EntityResource { @GET @Operation( + operationId = "listCharts", summary = "List charts", tags = "charts", description = @@ -148,6 +149,7 @@ public class ChartResource extends EntityResource { @GET @Path("/{id}/versions") @Operation( + operationId = "listAllChartVersions", summary = "List chart versions", tags = "charts", description = "Get a list of all the versions of a chart identified by `id`", @@ -168,6 +170,7 @@ public class ChartResource extends EntityResource { @GET @Path("/{id}") @Operation( + operationId = "getChartByID", summary = "Get a Chart", tags = "charts", description = "Get a chart by `id`.", @@ -200,6 +203,7 @@ public class ChartResource extends EntityResource { @GET @Path("/name/{fqn}") @Operation( + operationId = "getChartByFQN", summary = "Get a chart by name", tags = "charts", description = "Get a chart by fully qualified name.", @@ -232,6 +236,7 @@ public class ChartResource extends EntityResource { @GET @Path("/{id}/versions/{version}") @Operation( + operationId = "getSpecificChartVersion", summary = "Get a version of the chart", tags = "charts", description = "Get a version of the chart by given `id`", @@ -259,6 +264,7 @@ public class ChartResource extends EntityResource { @POST @Operation( + operationId = "createChart", summary = "Create a chart", tags = "charts", description = "Create a chart under an existing `service`.", @@ -266,7 +272,7 @@ public class ChartResource extends EntityResource { @ApiResponse( responseCode = "200", description = "The chart", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreateChart.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Chart.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response create(@Context UriInfo uriInfo, @Context SecurityContext securityContext, @Valid CreateChart create) @@ -278,6 +284,7 @@ public class ChartResource extends EntityResource { @PATCH @Path("/{id}") @Operation( + operationId = "patchChart", summary = "Update a chart", tags = "charts", description = "Update an existing chart using JsonPatch.", @@ -302,6 +309,7 @@ public class ChartResource extends EntityResource { @PUT @Operation( + operationId = "createOrUpdateChart", summary = "Create or update chart", tags = "charts", description = "Create a chart, it it does not exist or update an existing chart.", @@ -309,7 +317,7 @@ public class ChartResource extends EntityResource { @ApiResponse( responseCode = "200", description = "The updated chart ", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreateChart.class))) + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Chart.class))) }) public Response createOrUpdate( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @Valid CreateChart create) @@ -321,6 +329,7 @@ public class ChartResource extends EntityResource { @PUT @Path("/{id}/followers") @Operation( + operationId = "addFollowerToChart", summary = "Add a follower", tags = "charts", description = "Add a user identified by `userId` as followed of this chart", @@ -342,6 +351,7 @@ public class ChartResource extends EntityResource { @DELETE @Path("/{id}/followers/{userId}") @Operation( + operationId = "deleteFollowerFromChart", summary = "Remove a follower", tags = "charts", description = "Remove the user identified `userId` as a follower of the chart.") @@ -361,6 +371,7 @@ public class ChartResource extends EntityResource { @DELETE @Path("/{id}") @Operation( + operationId = "deleteChart", summary = "Delete a Chart", tags = "charts", description = "Delete a chart by `id`.", diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/config/ConfigResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/config/ConfigResource.java index 262f530a144..824e17908a7 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/config/ConfigResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/config/ConfigResource.java @@ -47,8 +47,9 @@ public class ConfigResource { @GET @Path(("/auth")) @Operation( + operationId = "getAuthConfiguration", summary = "Get auth configuration", - tags = "general", + tags = "config", responses = { @ApiResponse( responseCode = "200", @@ -69,8 +70,9 @@ public class ConfigResource { @GET @Path(("/authorizer")) @Operation( + operationId = "getAuthorizerConfig", summary = "Get authorizer configuration", - tags = "general", + tags = "config", responses = { @ApiResponse( responseCode = "200", @@ -91,8 +93,9 @@ public class ConfigResource { @GET @Path(("/sandbox")) @Operation( + operationId = "getSandboxConfiguration", summary = "Get sandbox mode", - tags = "general", + tags = "config", responses = { @ApiResponse( responseCode = "200", @@ -111,8 +114,9 @@ public class ConfigResource { @GET @Path(("/airflow")) @Operation( + operationId = "getAirflowConfiguration", summary = "Get airflow configuration", - tags = "general", + tags = "config", responses = { @ApiResponse( responseCode = "200", @@ -133,8 +137,9 @@ public class ConfigResource { @GET @Path(("/jwks")) @Operation( + operationId = "getJWKSResponse", summary = "Get JWKS public key", - tags = "general", + tags = "config", responses = { @ApiResponse( responseCode = "200", diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/dashboards/DashboardResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/dashboards/DashboardResource.java index 899ac116e48..f375f0344a9 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/dashboards/DashboardResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/dashboards/DashboardResource.java @@ -99,6 +99,7 @@ public class DashboardResource extends EntityResource { @GET @Operation( + operationId = "listTables", summary = "List tables", tags = "tables", description = @@ -170,6 +172,7 @@ public class TableResource extends EntityResource { @GET @Path("/{id}") @Operation( + operationId = "getTableByID", summary = "Get a table", tags = "tables", description = "Get a table by `id`", @@ -202,6 +205,7 @@ public class TableResource extends EntityResource { @GET @Path("/name/{fqn}") @Operation( + operationId = "getTableByFQN", summary = "Get a table by name", tags = "tables", description = "Get a table by fully qualified table name.", @@ -235,6 +239,7 @@ public class TableResource extends EntityResource { @GET @Path("/{id}/versions") @Operation( + operationId = "listAllTableVersion", summary = "List table versions", tags = "tables", description = "Get a list of all the versions of a table identified by `id`", @@ -255,6 +260,7 @@ public class TableResource extends EntityResource { @GET @Path("/{id}/versions/{version}") @Operation( + operationId = "getSpecificDatabaseVersion", summary = "Get a version of the table", tags = "tables", description = "Get a version of the table by given `id`", @@ -282,6 +288,7 @@ public class TableResource extends EntityResource { @POST @Operation( + operationId = "createTable", summary = "Create a table", tags = "tables", description = "Create a new table under an existing `database`.", @@ -289,7 +296,7 @@ public class TableResource extends EntityResource { @ApiResponse( responseCode = "200", description = "table", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreateTable.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Table.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response create(@Context UriInfo uriInfo, @Context SecurityContext securityContext, @Valid CreateTable create) @@ -300,6 +307,7 @@ public class TableResource extends EntityResource { @PUT @Operation( + operationId = "createOrUpdateTable", summary = "Create or update a table", tags = "tables", description = "Create a table, if it does not exist. If a table already exists, update the table.", @@ -307,7 +315,7 @@ public class TableResource extends EntityResource { @ApiResponse( responseCode = "200", description = "The table", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreateTable.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Table.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response createOrUpdate( @@ -320,6 +328,7 @@ public class TableResource extends EntityResource { @PATCH @Path("/{id}") @Operation( + operationId = "patchTable", summary = "Update a table", tags = "tables", description = "Update an existing table using JsonPatch.", @@ -345,6 +354,7 @@ public class TableResource extends EntityResource { @DELETE @Path("/{id}") @Operation( + operationId = "deleteTable", summary = "Delete a table", tags = "tables", description = "Delete a table by `id`. Table is not immediately deleted and is only marked as deleted.", @@ -367,11 +377,15 @@ public class TableResource extends EntityResource { @PUT @Path("/{id}/followers") @Operation( + operationId = "addFollowerToTable", summary = "Add a follower", tags = "tables", description = "Add a user identified by `userId` as followed of this table", responses = { - @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ChangeEvent.class))), @ApiResponse(responseCode = "404", description = "Table for instance {id} is not found") }) public Response addFollower( @@ -388,13 +402,17 @@ public class TableResource extends EntityResource { @PUT @Path("/{id}/joins") @Operation( + operationId = "addTableJoinInfo", summary = "Add table join information", description = "Add information about other tables that this table is joined with. Join information can only" + " be added for the last 30 days starting today.", tags = "tables", responses = { - @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse( + responseCode = "200", + description = "Successfully updated the Table", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Table.class))), @ApiResponse(responseCode = "404", description = "Table for instance {id} is not found"), @ApiResponse(responseCode = "400", description = "Date range can only include past 30 days starting" + " today") }) @@ -411,7 +429,17 @@ public class TableResource extends EntityResource { @PUT @Path("/{id}/sampleData") - @Operation(summary = "Add sample data", tags = "tables", description = "Add sample data to the table.") + @Operation( + operationId = "addSampleData", + summary = "Add sample data", + tags = "tables", + description = "Add sample data to the table.", + responses = { + @ApiResponse( + responseCode = "200", + description = "Successfully update the Table", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Table.class))) + }) public Table addSampleData( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @@ -425,7 +453,17 @@ public class TableResource extends EntityResource { @PUT @Path("/{id}/tableProfile") - @Operation(summary = "Add table profile data", tags = "tables", description = "Add table profile data to the table.") + @Operation( + operationId = "addDataProfiler", + summary = "Add table profile data", + tags = "tables", + description = "Add table profile data to the table.", + responses = { + @ApiResponse( + responseCode = "200", + description = "Successfully updated the Table ", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Table.class))) + }) public Table addDataProfiler( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @@ -440,11 +478,15 @@ public class TableResource extends EntityResource { @PUT @Path("/{id}/location") @Operation( + operationId = "addLocationToTable", summary = "Add a location", tags = "tables", description = "Add a location identified by `locationId` to this table", responses = { - @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Table.class))), @ApiResponse(responseCode = "404", description = "Table for instance {id} is not found") }) public Response addLocation( @@ -459,7 +501,17 @@ public class TableResource extends EntityResource { @PUT @Path("/{id}/tableQuery") - @Operation(summary = "Add table query data", tags = "tables", description = "Add table query data to the table.") + @Operation( + operationId = "addTableQuery", + summary = "Add table query data", + tags = "tables", + description = "Add table query data to the table.", + responses = { + @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Table.class))) + }) public Table addQuery( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @@ -474,9 +526,16 @@ public class TableResource extends EntityResource { @PUT @Path("/{id}/dataModel") @Operation( + operationId = "addDataModel", summary = "Add data modeling information to a table", tags = "tables", - description = "Add data modeling (such as DBT model) information on how the table was created to the table.") + description = "Add data modeling (such as DBT model) information on how the table was created to the table.", + responses = { + @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Table.class))) + }) public Table addDataModel( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @@ -490,7 +549,17 @@ public class TableResource extends EntityResource { @PUT @Path("/{id}/tableTest") - @Operation(summary = "Add table test cases", tags = "tables", description = "Add test cases to the table.") + @Operation( + operationId = "addTableTest", + summary = "Add table test cases", + tags = "tables", + description = "Add test cases to the table.", + responses = { + @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Table.class))) + }) public Table addTableTest( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @@ -505,7 +574,17 @@ public class TableResource extends EntityResource { @DELETE @Path("/{id}/tableTest/{tableTestType}") - @Operation(summary = "delete table test case", tags = "tables", description = "Delete test case from the table.") + @Operation( + operationId = "deleteTableTest", + summary = "delete table test case", + tags = "tables", + description = "Delete test case from the table.", + responses = { + @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Table.class))) + }) public Table deleteTableTest( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @@ -520,7 +599,17 @@ public class TableResource extends EntityResource { @PUT @Path("/{id}/columnTest") - @Operation(summary = "Add column test cases", tags = "tables", description = "Add column test cases to the table.") + @Operation( + operationId = "addColumnTest", + summary = "Add column test cases", + tags = "tables", + description = "Add column test cases to the table.", + responses = { + @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Table.class))) + }) public Table addColumnTest( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @@ -535,7 +624,17 @@ public class TableResource extends EntityResource { @PUT @Path("/{id}/customMetric") - @Operation(summary = "Add column custom metrics", tags = "tables", description = "Add column custom metrics.") + @Operation( + operationId = "addCustomMetric", + summary = "Add column custom metrics", + tags = "tables", + description = "Add column custom metrics.", + responses = { + @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Table.class))) + }) public Table addCustomMetric( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @@ -551,9 +650,16 @@ public class TableResource extends EntityResource { @DELETE @Path("/{id}/columnTest/{columnName}/{columnTestType}") @Operation( + operationId = "deleteColumnTest", summary = "delete column test case", tags = "tables", - description = "Delete column test case from the table.") + description = "Delete column test case from the table.", + responses = { + @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Table.class))) + }) public Table deleteColumnTest( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @@ -571,9 +677,16 @@ public class TableResource extends EntityResource { @DELETE @Path("/{id}/customMetric/{columnName}/{customMetricName}") @Operation( + operationId = "deleteCustomMetric", summary = "delete custom metric from a column", tags = "tables", - description = "Delete a custom metric from a column.") + description = "Delete a custom metric from a column.", + responses = { + @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Table.class))) + }) public Table deleteCustomMetric( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @@ -591,9 +704,16 @@ public class TableResource extends EntityResource { @DELETE @Path("/{id}/followers/{userId}") @Operation( + operationId = "deleteFollower", summary = "Remove a follower", tags = "tables", - description = "Remove the user identified `userId` as a follower of the table.") + description = "Remove the user identified `userId` as a follower of the table.", + responses = { + @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ChangeEvent.class))) + }) public Response deleteFollower( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @@ -609,7 +729,17 @@ public class TableResource extends EntityResource { @DELETE @Path("/{id}/location") - @Operation(summary = "Remove the location", tags = "tables", description = "Remove the location") + @Operation( + operationId = "deleteLocation", + summary = "Remove the location", + tags = "tables", + description = "Remove the location", + responses = { + @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Table.class))) + }) public Table deleteLocation( @Context UriInfo uriInfo, @Context SecurityContext securityContext, diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/events/EventResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/events/EventResource.java index b5f1811526b..39f0ed8cb83 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/events/EventResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/events/EventResource.java @@ -68,6 +68,7 @@ public class EventResource { @GET @Valid @Operation( + operationId = "listChangeEvents", summary = "Get change events", tags = "events", description = "Get a list of change events matching event types, entity type, from a given date", @@ -75,7 +76,8 @@ public class EventResource { @ApiResponse( responseCode = "200", description = "Entity events", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = ChangeEvent.class))), + content = + @Content(mediaType = "application/json", schema = @Schema(implementation = ChangeEventList.class))), @ApiResponse(responseCode = "404", description = "Entity for instance {id} is not found") }) public ResultList get( diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/events/WebhookResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/events/WebhookResource.java index 6ca28def50e..a9dea44211e 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/events/WebhookResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/events/WebhookResource.java @@ -55,7 +55,6 @@ import org.openmetadata.catalog.jdbi3.WebhookRepository; import org.openmetadata.catalog.resources.Collection; import org.openmetadata.catalog.resources.EntityResource; import org.openmetadata.catalog.security.Authorizer; -import org.openmetadata.catalog.type.ChangeEvent; import org.openmetadata.catalog.type.EntityHistory; import org.openmetadata.catalog.type.Include; import org.openmetadata.catalog.type.Webhook; @@ -92,6 +91,7 @@ public class WebhookResource extends EntityResource @GET @Operation( + operationId = "listWebHooks", summary = "List webhooks", tags = "webhook", description = "Get a list of webhook subscriptions", @@ -131,6 +131,7 @@ public class WebhookResource extends EntityResource @Path("/{id}") @Valid @Operation( + operationId = "getWebHookByID", summary = "Get a webhook", tags = "webhook", description = "Get a webhook by given Id", @@ -138,7 +139,7 @@ public class WebhookResource extends EntityResource @ApiResponse( responseCode = "200", description = "Entity events", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = ChangeEvent.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Webhook.class))), @ApiResponse(responseCode = "404", description = "Entity for instance {id} is not found") }) public Webhook get( @@ -158,6 +159,7 @@ public class WebhookResource extends EntityResource @GET @Path("/name/{name}") @Operation( + operationId = "getWebHookByFQN", summary = "Get a webhook by name", tags = "webhook", description = "Get a webhook by name.", @@ -185,6 +187,7 @@ public class WebhookResource extends EntityResource @GET @Path("/{id}/versions") @Operation( + operationId = "listAllWebHookVersion", summary = "List webhook versions", tags = "webhook", description = "Get a list of all the versions of a webhook identified by `id`", @@ -205,6 +208,7 @@ public class WebhookResource extends EntityResource @GET @Path("/{id}/versions/{version}") @Operation( + operationId = "getSpecificWebhookVersion", summary = "Get a version of the webhook", tags = "webhook", description = "Get a version of the webhook by given `id`", @@ -232,6 +236,7 @@ public class WebhookResource extends EntityResource @POST @Operation( + operationId = "createWebHook", summary = "Subscribe to a new webhook", tags = "webhook", description = "Subscribe to a new webhook", @@ -253,6 +258,7 @@ public class WebhookResource extends EntityResource @PUT @Operation( + operationId = "createOrUpdateWebhook", summary = "Updated an existing or create a new webhook", tags = "webhook", description = "Updated an existing or create a new webhook", @@ -275,6 +281,7 @@ public class WebhookResource extends EntityResource @PATCH @Path("/{id}") @Operation( + operationId = "patchWebHook", summary = "Update a webhook", tags = "webhook", description = "Update an existing webhook using JsonPatch.", @@ -301,6 +308,7 @@ public class WebhookResource extends EntityResource @Path("/{id}") @Valid @Operation( + operationId = "deleteWebHook", summary = "Delete a webhook", tags = "webhook", description = "Get a webhook by given Id", diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/feeds/FeedResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/feeds/FeedResource.java index 0484af71647..4ef82da2a50 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/feeds/FeedResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/feeds/FeedResource.java @@ -115,6 +115,7 @@ public class FeedResource { @GET @Operation( + operationId = "listThreads", summary = "List threads", tags = "feeds", description = "Get a list of threads, optionally filtered by `entityLink`.", @@ -184,6 +185,7 @@ public class FeedResource { @GET @Path("/{id}") @Operation( + operationId = "getThreadByID", summary = "Get a thread", tags = "feeds", description = "Get a thread by `id`.", @@ -201,6 +203,7 @@ public class FeedResource { @PATCH @Path("/{id}") @Operation( + operationId = "patchThread", summary = "Update a thread by `id`.", tags = "feeds", description = "Update an existing thread using JsonPatch.", @@ -228,6 +231,7 @@ public class FeedResource { @GET @Path("/count") @Operation( + operationId = "countThreads", summary = "count of threads", tags = "feeds", description = "Get a count of threads, optionally filtered by `entityLink` for each of the entities.", @@ -253,6 +257,7 @@ public class FeedResource { @POST @Operation( + operationId = "createThread", summary = "Create a thread", tags = "feeds", description = "Create a new thread. A thread is created about a data asset when a user posts the first post.", @@ -260,7 +265,7 @@ public class FeedResource { @ApiResponse( responseCode = "200", description = "The thread", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreateThread.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Thread.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response create(@Context UriInfo uriInfo, @Context SecurityContext securityContext, @Valid CreateThread create) @@ -273,6 +278,7 @@ public class FeedResource { @POST @Path("/{id}/posts") @Operation( + operationId = "addPostToThread", summary = "Add post to a thread", tags = "feeds", description = "Add a post to an existing thread.", @@ -280,7 +286,7 @@ public class FeedResource { @ApiResponse( responseCode = "200", description = "The post", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreatePost.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Thread.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response addPost( @@ -297,6 +303,7 @@ public class FeedResource { @DELETE @Path("/{threadId}/posts/{postId}") @Operation( + operationId = "deletePostFromThread", summary = "Delete a post from its thread", tags = "feeds", description = "Delete a post from an existing thread.", @@ -325,6 +332,7 @@ public class FeedResource { @GET @Path("/{id}/posts") @Operation( + operationId = "getAllPostOfThread", summary = "Get all the posts of a thread", tags = "feeds", description = "Get all the posts of an existing thread.", diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/glossary/GlossaryResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/glossary/GlossaryResource.java index e735f520d1a..716daa92f98 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/glossary/GlossaryResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/glossary/GlossaryResource.java @@ -100,6 +100,7 @@ public class GlossaryResource extends EntityResource @GET @Operation( + operationId = "listMetrics", summary = "List metrics", tags = "metrics", description = "Get a list of metrics. Use `fields` parameter to get only necessary fields.", @@ -112,6 +113,7 @@ public class MetricsResource extends EntityResource @GET @Path("/{id}") @Operation( + operationId = "getMetricByID", summary = "Get a metric", tags = "metrics", description = "Get a metric by `id`.", @@ -143,6 +145,7 @@ public class MetricsResource extends EntityResource @POST @Operation( + operationId = "createMetric", summary = "Create a metric", tags = "metrics", description = "Create a new metric.", @@ -161,6 +164,7 @@ public class MetricsResource extends EntityResource @PUT @Operation( + operationId = "createOrUpdateMetric", summary = "Create or update a metric", tags = "metrics", description = "Create a new metric, if it does not exist or update an existing metric.", diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/mlmodels/MlModelResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/mlmodels/MlModelResource.java index c9d3c45aa06..5d6a430eb94 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/mlmodels/MlModelResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/mlmodels/MlModelResource.java @@ -58,6 +58,7 @@ import org.openmetadata.catalog.jdbi3.MlModelRepository; import org.openmetadata.catalog.resources.Collection; import org.openmetadata.catalog.resources.EntityResource; import org.openmetadata.catalog.security.Authorizer; +import org.openmetadata.catalog.type.ChangeEvent; import org.openmetadata.catalog.type.EntityHistory; import org.openmetadata.catalog.type.Include; import org.openmetadata.catalog.util.RestUtil; @@ -100,6 +101,7 @@ public class MlModelResource extends EntityResource @GET @Valid @Operation( + operationId = "listMlModels", summary = "List ML Models", tags = "mlModels", description = @@ -146,6 +148,7 @@ public class MlModelResource extends EntityResource @GET @Path("/{id}") @Operation( + operationId = "getMlModelByID", summary = "Get an ML Model", tags = "mlModels", description = "Get an ML Model by `id`.", @@ -178,6 +181,7 @@ public class MlModelResource extends EntityResource @GET @Path("/name/{fqn}") @Operation( + operationId = "getMlModelByFQN", summary = "Get an ML Model by name", tags = "mlModels", description = "Get an ML Model by fully qualified name.", @@ -209,6 +213,7 @@ public class MlModelResource extends EntityResource @POST @Operation( + operationId = "createMlModel", summary = "Create an ML Model", tags = "mlModels", description = "Create a new ML Model.", @@ -216,7 +221,7 @@ public class MlModelResource extends EntityResource @ApiResponse( responseCode = "200", description = "ML Model", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreateMlModel.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = MlModel.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response create( @@ -229,6 +234,7 @@ public class MlModelResource extends EntityResource @PATCH @Path("/{id}") @Operation( + operationId = "patchMlModel", summary = "Update an ML Model", tags = "mlModels", description = "Update an existing ML Model using JsonPatch.", @@ -253,6 +259,7 @@ public class MlModelResource extends EntityResource @PUT @Operation( + operationId = "createOrUpdateMlModel", summary = "Create or update an ML Model", tags = "mlModels", description = "Create a new ML Model, if it does not exist or update an existing model.", @@ -273,11 +280,15 @@ public class MlModelResource extends EntityResource @PUT @Path("/{id}/followers") @Operation( + operationId = "addFollower", summary = "Add a follower", tags = "mlModels", description = "Add a user identified by `userId` as follower of this model", responses = { - @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ChangeEvent.class))), @ApiResponse(responseCode = "404", description = "model for instance {id} is not found") }) public Response addFollower( @@ -294,9 +305,16 @@ public class MlModelResource extends EntityResource @DELETE @Path("/{id}/followers/{userId}") @Operation( + operationId = "deleteFollower", summary = "Remove a follower", tags = "mlModels", - description = "Remove the user identified `userId` as a follower of the model.") + description = "Remove the user identified `userId` as a follower of the model.", + responses = { + @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ChangeEvent.class))), + }) public Response deleteFollower( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @@ -313,6 +331,7 @@ public class MlModelResource extends EntityResource @GET @Path("/{id}/versions") @Operation( + operationId = "listAllMlModelVersion", summary = "List Ml Model versions", tags = "mlModels", description = "Get a list of all the versions of an Ml Model identified by `id`", @@ -333,6 +352,7 @@ public class MlModelResource extends EntityResource @GET @Path("/{id}/versions/{version}") @Operation( + operationId = "getSpecificMlModelVersion", summary = "Get a version of the ML Model", tags = "mlModels", description = "Get a version of the ML Model by given `id`", @@ -361,6 +381,7 @@ public class MlModelResource extends EntityResource @DELETE @Path("/{id}") @Operation( + operationId = "deleteMlModel", summary = "Delete an ML Model", tags = "mlModels", description = "Delete an ML Model by `id`.", diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/permissions/PermissionsResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/permissions/PermissionsResource.java index e8c4d355466..b0f75dc1831 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/permissions/PermissionsResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/permissions/PermissionsResource.java @@ -46,7 +46,7 @@ public class PermissionsResource { @GET @Operation( summary = "Get permissions for logged in user", - tags = "general", + tags = "permission", responses = { @ApiResponse( responseCode = "200", diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/pipelines/PipelineResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/pipelines/PipelineResource.java index 918c174d9fa..dcd114ee3c2 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/pipelines/PipelineResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/pipelines/PipelineResource.java @@ -60,6 +60,7 @@ import org.openmetadata.catalog.resources.Collection; import org.openmetadata.catalog.resources.EntityResource; import org.openmetadata.catalog.security.Authorizer; import org.openmetadata.catalog.security.SecurityUtil; +import org.openmetadata.catalog.type.ChangeEvent; import org.openmetadata.catalog.type.EntityHistory; import org.openmetadata.catalog.type.Include; import org.openmetadata.catalog.util.RestUtil; @@ -102,6 +103,7 @@ public class PipelineResource extends EntityResource { @GET @Valid @Operation( + operationId = "listPolicies", summary = "List Policies", tags = "policies", description = @@ -154,6 +155,7 @@ public class PolicyResource extends EntityResource { @GET @Path("/{id}") @Operation( + operationId = "getPolicyByID", summary = "Get a policy", tags = "policies", description = "Get a policy by `id`.", @@ -186,6 +188,7 @@ public class PolicyResource extends EntityResource { @GET @Path("/name/{fqn}") @Operation( + operationId = "getPolicyByFQN", summary = "Get a policy by name", tags = "policies", description = "Get a policy by fully qualified name.", @@ -218,6 +221,7 @@ public class PolicyResource extends EntityResource { @GET @Path("/{id}/versions") @Operation( + operationId = "listAllPolicyVersion", summary = "List policy versions", tags = "policies", description = "Get a list of all the versions of a policy identified by `id`", @@ -238,6 +242,7 @@ public class PolicyResource extends EntityResource { @GET @Path("/{id}/versions/{version}") @Operation( + operationId = "getSpecificPolicyVersion", summary = "Get a version of the policy", tags = "policies", description = "Get a version of the policy by given `id`", @@ -265,6 +270,7 @@ public class PolicyResource extends EntityResource { @POST @Operation( + operationId = "createPolicy", summary = "Create a policy", tags = "policies", description = "Create a new policy.", @@ -272,7 +278,7 @@ public class PolicyResource extends EntityResource { @ApiResponse( responseCode = "200", description = "The policy", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreatePolicy.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Policy.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response create(@Context UriInfo uriInfo, @Context SecurityContext securityContext, @Valid CreatePolicy create) @@ -286,6 +292,7 @@ public class PolicyResource extends EntityResource { @PATCH @Path("/{id}") @Operation( + operationId = "patchPolicy", summary = "Update a policy", tags = "policies", description = "Update an existing policy using JsonPatch.", @@ -312,6 +319,7 @@ public class PolicyResource extends EntityResource { @PUT @Operation( + operationId = "createOrUpdatePolicy", summary = "Create or update a policy", tags = "policies", description = "Create a new policy, if it does not exist or update an existing policy.", @@ -334,6 +342,7 @@ public class PolicyResource extends EntityResource { @DELETE @Path("/{id}") @Operation( + operationId = "deletePolicy", summary = "Delete a Policy", tags = "policies", description = "Delete a policy by `id`.", diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/reports/ReportResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/reports/ReportResource.java index bd56a881da1..d1dfa140751 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/reports/ReportResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/reports/ReportResource.java @@ -79,6 +79,7 @@ public class ReportResource extends EntityResource { @GET @Operation( + operationId = "listReports", summary = "List reports", tags = "reports", description = "Get a list of reports. Use `fields` parameter to get only necessary fields.", @@ -104,6 +105,7 @@ public class ReportResource extends EntityResource { @GET @Path("/{id}") @Operation( + operationId = "getReportByID", summary = "Get a report", tags = "reports", description = "Get a report by `id`.", @@ -135,6 +137,7 @@ public class ReportResource extends EntityResource { @POST @Operation( + operationId = "getReportByFQN", summary = "Create a report", tags = "reports", description = "Create a new report.", @@ -153,6 +156,7 @@ public class ReportResource extends EntityResource { @PUT @Operation( + operationId = "createOrUpdateReport", summary = "Create or update a report", tags = "reports", description = "Create a new report, it it does not exist or update an existing report.", diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/search/SearchResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/search/SearchResource.java index b2cdc8fd9c5..ef14b6314cd 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/search/SearchResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/search/SearchResource.java @@ -73,6 +73,7 @@ public class SearchResource { @GET @Path("/query") @Operation( + operationId = "searchEntitiesWithQuery", summary = "Search entities", tags = "search", description = @@ -182,6 +183,7 @@ public class SearchResource { @GET @Path("/suggest") @Operation( + operationId = "getSuggestedEntities", summary = "Suggest entities", tags = "search", description = "Get suggested entities used for auto-completion.", @@ -189,7 +191,7 @@ public class SearchResource { @ApiResponse( responseCode = "200", description = "Table Suggestion API", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = SearchResponse.class))) + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Suggest.class))) }) public Response suggest( @Context UriInfo uriInfo, diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/services/ServiceResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/services/ServiceResource.java index dbd5fac5581..43cb5470f22 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/services/ServiceResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/services/ServiceResource.java @@ -29,7 +29,6 @@ import org.openmetadata.catalog.resources.CatalogResource.CollectionList; import org.openmetadata.catalog.resources.Collection; import org.openmetadata.catalog.resources.CollectionRegistry; import org.openmetadata.catalog.type.CollectionDescriptor; -import org.openmetadata.catalog.type.CollectionInfo; @Path("/v1/services") @Api(value = "Services collection", tags = "Services collection") @@ -48,6 +47,7 @@ public class ServiceResource { @GET @Operation( + operationId = "listServiceCollection", summary = "List service collections", tags = "services", description = "Get a list of resources under service collection.", @@ -55,7 +55,7 @@ public class ServiceResource { @ApiResponse( responseCode = "200", description = "List of serviceCollections", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CollectionInfo.class))) + content = @Content(mediaType = "application/json", schema = @Schema(implementation = CollectionList.class))) }) public CollectionList getCollections(@Context UriInfo uriInfo) { return getServiceList(uriInfo); diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/services/dashboard/DashboardServiceResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/services/dashboard/DashboardServiceResource.java index 24507f7e532..f3a81004d21 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/services/dashboard/DashboardServiceResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/services/dashboard/DashboardServiceResource.java @@ -90,8 +90,9 @@ public class DashboardServiceResource extends EntityResource { @GET @Valid @Operation( + operationId = "listRoles", summary = "List roles", tags = "roles", description = @@ -190,6 +191,7 @@ public class RoleResource extends EntityResource { @GET @Path("/{id}/versions") @Operation( + operationId = "listAllRoleVersion", summary = "List role versions", tags = "roles", description = "Get a list of all the versions of a role identified by `id`", @@ -211,6 +213,7 @@ public class RoleResource extends EntityResource { @Valid @Path("/{id}") @Operation( + operationId = "getRoleByID", summary = "Get a role", tags = "roles", description = "Get a role by `id`.", @@ -244,6 +247,7 @@ public class RoleResource extends EntityResource { @Valid @Path("/name/{name}") @Operation( + operationId = "getRoleByFQN", summary = "Get a role by name", tags = "roles", description = "Get a role by `name`.", @@ -276,6 +280,7 @@ public class RoleResource extends EntityResource { @GET @Path("/{id}/versions/{version}") @Operation( + operationId = "getSpecificRoleVersion", summary = "Get a version of the role", tags = "roles", description = "Get a version of the role by given `id`", @@ -303,6 +308,7 @@ public class RoleResource extends EntityResource { @POST @Operation( + operationId = "createRole", summary = "Create a role", tags = "roles", description = "Create a new role.", @@ -310,7 +316,7 @@ public class RoleResource extends EntityResource { @ApiResponse( responseCode = "200", description = "The role", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreateRole.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Role.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response create( @@ -324,6 +330,7 @@ public class RoleResource extends EntityResource { @PUT @Operation( + operationId = "createOrUpdateRole", summary = "Update role", tags = "roles", description = "Create or Update a role.", @@ -331,7 +338,7 @@ public class RoleResource extends EntityResource { @ApiResponse( responseCode = "200", description = "The role ", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreateRole.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Role.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response createOrUpdateRole( @@ -347,6 +354,7 @@ public class RoleResource extends EntityResource { @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON_PATCH_JSON) @Operation( + operationId = "patchRole", summary = "Update a role", tags = "roles", description = "Update an existing role with JsonPatch.", @@ -373,6 +381,7 @@ public class RoleResource extends EntityResource { @DELETE @Path("/{id}") @Operation( + operationId = "deleteRole", summary = "Delete a role", tags = "roles", description = "Delete a role by given `id`.", diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/teams/TeamResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/teams/TeamResource.java index 7a9b2e4faf8..eba283f0b85 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/teams/TeamResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/teams/TeamResource.java @@ -96,6 +96,7 @@ public class TeamResource extends EntityResource { @GET @Valid @Operation( + operationId = "listTeams", summary = "List teams", tags = "teams", description = @@ -142,6 +143,7 @@ public class TeamResource extends EntityResource { @GET @Path("/{id}/versions") @Operation( + operationId = "listAllTeamVersion", summary = "List team versions", tags = "teams", description = "Get a list of all the versions of a team identified by `id`", @@ -163,6 +165,7 @@ public class TeamResource extends EntityResource { @Valid @Path("/{id}") @Operation( + operationId = "getTeamByID", summary = "Get a team", tags = "teams", description = "Get a team by `id`.", @@ -196,6 +199,7 @@ public class TeamResource extends EntityResource { @Valid @Path("/name/{name}") @Operation( + operationId = "getTeamByFQN", summary = "Get a team by name", tags = "teams", description = "Get a team by `name`.", @@ -228,6 +232,7 @@ public class TeamResource extends EntityResource { @GET @Path("/{id}/versions/{version}") @Operation( + operationId = "getSpecificRoleVersion", summary = "Get a version of the team", tags = "teams", description = "Get a version of the team by given `id`", @@ -255,6 +260,7 @@ public class TeamResource extends EntityResource { @POST @Operation( + operationId = "createTeam", summary = "Create a team", tags = "teams", description = "Create a new team.", @@ -262,7 +268,7 @@ public class TeamResource extends EntityResource { @ApiResponse( responseCode = "200", description = "The team", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreateTeam.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Team.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response create(@Context UriInfo uriInfo, @Context SecurityContext securityContext, @Valid CreateTeam ct) @@ -273,6 +279,7 @@ public class TeamResource extends EntityResource { @PUT @Operation( + operationId = "createOrUpdateTeam", summary = "Update team", tags = "teams", description = "Create or Update a team.", @@ -280,7 +287,7 @@ public class TeamResource extends EntityResource { @ApiResponse( responseCode = "200", description = "The team ", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreateTeam.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Team.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response createOrUpdate( @@ -293,6 +300,7 @@ public class TeamResource extends EntityResource { @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON_PATCH_JSON) @Operation( + operationId = "patchTeam", summary = "Update a team", tags = "teams", description = "Update an existing team with JsonPatch.", @@ -317,6 +325,7 @@ public class TeamResource extends EntityResource { @DELETE @Path("/{id}") @Operation( + operationId = "deleteTeam", summary = "Delete a team", tags = "teams", description = "Delete a team by given `id`.", diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/teams/UserResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/teams/UserResource.java index 7b1e3fab087..fd012caf67e 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/teams/UserResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/teams/UserResource.java @@ -115,6 +115,7 @@ public class UserResource extends EntityResource { @GET @Valid @Operation( + operationId = "listUsers", summary = "List users", tags = "users", description = @@ -164,6 +165,7 @@ public class UserResource extends EntityResource { @GET @Path("/{id}/versions") @Operation( + operationId = "listAllUserVersion", summary = "List user versions", tags = "users", description = "Get a list of all the versions of a user identified by `id`", @@ -185,6 +187,7 @@ public class UserResource extends EntityResource { @Valid @Path("/{id}") @Operation( + operationId = "getUserByID", summary = "Get a user", tags = "users", description = "Get a user by `id`", @@ -218,6 +221,7 @@ public class UserResource extends EntityResource { @Valid @Path("/name/{name}") @Operation( + operationId = "getUserByFQN", summary = "Get a user by name", tags = "users", description = "Get a user by `name`.", @@ -251,6 +255,7 @@ public class UserResource extends EntityResource { @Valid @Path("/loggedInUser") @Operation( + operationId = "getCurrentLoggedInUser", summary = "Get current logged in user", tags = "users", description = "Get the user who is authenticated and is currently logged in.", @@ -279,6 +284,7 @@ public class UserResource extends EntityResource { @GET @Path("/{id}/versions/{version}") @Operation( + operationId = "getSpecificUserVersion", summary = "Get a version of the user", tags = "users", description = "Get a version of the user by given `id`", @@ -306,6 +312,7 @@ public class UserResource extends EntityResource { @POST @Operation( + operationId = "createUser", summary = "Create a user", tags = "users", description = "Create a new user.", @@ -313,7 +320,7 @@ public class UserResource extends EntityResource { @ApiResponse( responseCode = "200", description = "The user ", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreateUser.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = User.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response createUser( @@ -355,6 +362,7 @@ public class UserResource extends EntityResource { @PUT @Path("/generateToken/{id}") @Operation( + operationId = "generateJWTTokenForBotUser", summary = "Generate JWT Token for a Bot User", tags = "users", description = "Generate JWT Token for a Bot User.", @@ -391,6 +399,7 @@ public class UserResource extends EntityResource { @PUT @Path("/revokeToken/{id}") @Operation( + operationId = "revokeJWTTokenForBotUser", summary = "Revoke JWT Token for a Bot User", tags = "users", description = "Revoke JWT Token for a Bot User.", @@ -423,6 +432,7 @@ public class UserResource extends EntityResource { @GET @Path("/token/{id}") @Operation( + operationId = "getJWTTokenForBotUser", summary = "Get JWT Token for a Bot User", tags = "users", description = "Get JWT Token for a Bot User.", @@ -456,6 +466,7 @@ public class UserResource extends EntityResource { @Path("/{id}") @Consumes(MediaType.APPLICATION_JSON_PATCH_JSON) @Operation( + operationId = "patchUser", summary = "Update a user", tags = "users", description = "Update an existing user using JsonPatch.", @@ -508,6 +519,7 @@ public class UserResource extends EntityResource { @DELETE @Path("/{id}") @Operation( + operationId = "deleteUser", summary = "Delete a user", tags = "users", description = "Users can't be deleted but are soft-deleted.", diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/topics/TopicResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/topics/TopicResource.java index 38719be51d1..cfb99ebd2de 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/topics/TopicResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/topics/TopicResource.java @@ -60,6 +60,7 @@ import org.openmetadata.catalog.resources.Collection; import org.openmetadata.catalog.resources.EntityResource; import org.openmetadata.catalog.security.Authorizer; import org.openmetadata.catalog.security.SecurityUtil; +import org.openmetadata.catalog.type.ChangeEvent; import org.openmetadata.catalog.type.EntityHistory; import org.openmetadata.catalog.type.Include; import org.openmetadata.catalog.type.topic.TopicSampleData; @@ -101,6 +102,7 @@ public class TopicResource extends EntityResource { @GET @Operation( + operationId = "listTopics", summary = "List topics", tags = "topics", description = @@ -152,6 +154,7 @@ public class TopicResource extends EntityResource { @GET @Path("/{id}/versions") @Operation( + operationId = "listAllTopicVersion", summary = "List topic versions", tags = "topics", description = "Get a list of all the versions of a topic identified by `id`", @@ -204,6 +207,7 @@ public class TopicResource extends EntityResource { @GET @Path("/name/{fqn}") @Operation( + operationId = "getTopicByFQN", summary = "Get a topic by name", tags = "topics", description = "Get a topic by fully qualified name.", @@ -236,6 +240,7 @@ public class TopicResource extends EntityResource { @GET @Path("/{id}/versions/{version}") @Operation( + operationId = "getSpecificTopicVersion", summary = "Get a version of the topic", tags = "topics", description = "Get a version of the topic by given `id`", @@ -263,6 +268,7 @@ public class TopicResource extends EntityResource { @POST @Operation( + operationId = "createTopic", summary = "Create a topic", tags = "topics", description = "Create a topic under an existing `service`.", @@ -270,7 +276,7 @@ public class TopicResource extends EntityResource { @ApiResponse( responseCode = "200", description = "The topic", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreateTopic.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Topic.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response create(@Context UriInfo uriInfo, @Context SecurityContext securityContext, @Valid CreateTopic create) @@ -282,6 +288,7 @@ public class TopicResource extends EntityResource { @PATCH @Path("/{id}") @Operation( + operationId = "patchTopic", summary = "Update a topic", tags = "topics", description = "Update an existing topic using JsonPatch.", @@ -306,6 +313,7 @@ public class TopicResource extends EntityResource { @PUT @Operation( + operationId = "createOrUpdateTopic", summary = "Update topic", tags = "topics", description = "Create a topic, it it does not exist or update an existing topic.", @@ -313,7 +321,7 @@ public class TopicResource extends EntityResource { @ApiResponse( responseCode = "200", description = "The updated topic ", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreateTopic.class))) + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Topic.class))) }) public Response createOrUpdate( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @Valid CreateTopic create) @@ -324,7 +332,17 @@ public class TopicResource extends EntityResource { @PUT @Path("/{id}/sampleData") - @Operation(summary = "Add sample data", tags = "topics", description = "Add sample data to the topic.") + @Operation( + operationId = "addSampleData", + summary = "Add sample data", + tags = "topics", + description = "Add sample data to the topic.", + responses = { + @ApiResponse( + responseCode = "200", + description = "The topic", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Topic.class))), + }) public Topic addSampleData( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @@ -339,11 +357,15 @@ public class TopicResource extends EntityResource { @PUT @Path("/{id}/followers") @Operation( + operationId = "addFollower", summary = "Add a follower", tags = "topics", description = "Add a user identified by `userId` as followed of this topic", responses = { - @ApiResponse(responseCode = "200", description = "OK"), + @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ChangeEvent.class))), @ApiResponse(responseCode = "404", description = "Topic for instance {id} is not found") }) public Response addFollower( @@ -362,7 +384,13 @@ public class TopicResource extends EntityResource { @Operation( summary = "Remove a follower", tags = "topics", - description = "Remove the user identified `userId` as a follower of the topic.") + description = "Remove the user identified `userId` as a follower of the topic.", + responses = { + @ApiResponse( + responseCode = "200", + description = "OK", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ChangeEvent.class))) + }) public Response deleteFollower( @Context UriInfo uriInfo, @Context SecurityContext securityContext, @@ -379,6 +407,7 @@ public class TopicResource extends EntityResource { @DELETE @Path("/{id}") @Operation( + operationId = "deleteTopic", summary = "Delete a topic", tags = "topics", description = "Delete a topic by `id`.", diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/types/TypeResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/types/TypeResource.java index 77dcda8244d..9b7602af3ee 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/types/TypeResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/types/TypeResource.java @@ -124,6 +124,7 @@ public class TypeResource extends EntityResource { @GET @Valid @Operation( + operationId = "listTypes", summary = "List types", tags = "metadata", description = @@ -164,6 +165,7 @@ public class TypeResource extends EntityResource { @GET @Path("/{id}") @Operation( + operationId = "getTypeByID", summary = "Get a type", tags = "metadata", description = "Get a type by `id`.", @@ -196,6 +198,7 @@ public class TypeResource extends EntityResource { @GET @Path("/name/{name}") @Operation( + operationId = "getTypeByFQN", summary = "Get a type by name", tags = "metadata", description = "Get a type by name.", @@ -228,6 +231,7 @@ public class TypeResource extends EntityResource { @GET @Path("/{id}/versions") @Operation( + operationId = "listAllTypeVersion", summary = "List type versions", tags = "metadata", description = "Get a list of all the versions of a type identified by `id`", @@ -248,6 +252,7 @@ public class TypeResource extends EntityResource { @GET @Path("/{id}/versions/{version}") @Operation( + operationId = "getSpecificTypeVersion", summary = "Get a version of the types", tags = "metadata", description = "Get a version of the type by given `id`", @@ -275,6 +280,7 @@ public class TypeResource extends EntityResource { @POST @Operation( + operationId = "createType", summary = "Create a type", tags = "metadata", description = "Create a new type.", @@ -282,7 +288,7 @@ public class TypeResource extends EntityResource { @ApiResponse( responseCode = "200", description = "The type", - content = @Content(mediaType = "application/json", schema = @Schema(implementation = CreateType.class))), + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Type.class))), @ApiResponse(responseCode = "400", description = "Bad request") }) public Response create(@Context UriInfo uriInfo, @Context SecurityContext securityContext, @Valid CreateType create) @@ -294,6 +300,7 @@ public class TypeResource extends EntityResource { @PATCH @Path("/{id}") @Operation( + operationId = "patchType", summary = "Update a type", tags = "metadata", description = "Update an existing type using JsonPatch.", @@ -337,6 +344,7 @@ public class TypeResource extends EntityResource { @DELETE @Path("/{id}") @Operation( + operationId = "deleteType", summary = "Delete a type", tags = "metadata", description = "Delete a type by `id`.", @@ -355,6 +363,7 @@ public class TypeResource extends EntityResource { @PUT @Path("/{id}") @Operation( + operationId = "addField", summary = "Add a field to an entity", tags = "metadata", description = "Add a field to an entity type. Fields can only be added to entity type and not field type.", diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/usage/UsageResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/usage/UsageResource.java index be42b10981d..0d371938823 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/usage/UsageResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/usage/UsageResource.java @@ -64,6 +64,7 @@ public class UsageResource { @Valid @Path("/{entity}/{id}") @Operation( + operationId = "getEntityUsageByID", summary = "Get usage", tags = "usage", description = "Get usage details for an entity identified by `id`.", @@ -104,6 +105,7 @@ public class UsageResource { @Valid @Path("/{entity}/name/{fqn}") @Operation( + operationId = "getEntityUsageByFQN", summary = "Get usage by name", tags = "usage", description = "Get usage details for an entity identified by fully qualified name.", @@ -146,6 +148,7 @@ public class UsageResource { @POST @Path("/{entity}/{id}") @Operation( + operationId = "reportEntityUsageWithID", summary = "Report usage", tags = "usage", description = @@ -177,6 +180,7 @@ public class UsageResource { @POST @Path("/{entity}/name/{fqn}") @Operation( + operationId = "reportEntityUsageWithFQN", summary = "Report usage by name", tags = "usage", description = @@ -212,6 +216,7 @@ public class UsageResource { @POST @Path("/compute.percentile/{entity}/{date}") @Operation( + operationId = "computeEntityUsagePercentile", summary = "Compute percentiles", tags = "usage", description = "Compute percentile ranking for an entity based on last 30 days of usage.", diff --git a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/version/VersionResource.java b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/version/VersionResource.java index 696eaef0eb1..49926cd6c3c 100644 --- a/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/version/VersionResource.java +++ b/catalog-rest-service/src/main/java/org/openmetadata/catalog/resources/version/VersionResource.java @@ -53,8 +53,9 @@ public class VersionResource { @GET @Operation( + operationId = "getCatalogVersion", summary = "Get version of metadata service", - tags = "general", + tags = "catalog", description = "Get the build version of OpenMetadata service and build timestamp.") public CatalogVersion getCatalogVersion() { return CATALOG_VERSION;