fix(openapi): adds in previously ignored keep alive value (#12068)

This commit is contained in:
RyanHolstien 2024-12-10 13:25:41 -06:00 committed by GitHub
parent bcf230f87f
commit a290b24a7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 15 additions and 3 deletions

View File

@ -39,6 +39,7 @@ This file documents any backwards-incompatible changes in DataHub and assists pe
- #11742: For PowerBi ingestion, `use_powerbi_email` is now enabled by default when extracting ownership information.
- #12056: The DataHub Airflow plugin no longer supports Airflow 2.1 and Airflow 2.2.
- #12056: The DataHub Airflow plugin now defaults to the v2 plugin implementation.
- OpenAPI Update: PIT Keep Alive parameter added to scroll. NOTE: This parameter requires the `pointInTimeCreationEnabled` feature flag to be enabled and the `elasticSearch.implementation` configuration to be `elasticsearch`. This feature is not supported for OpenSearch at this time and the parameter will not be respected without both of these set.
### Breaking Changes

View File

@ -199,7 +199,9 @@ public abstract class GenericEntitiesController<
@RequestParam(value = "skipCache", required = false, defaultValue = "false")
Boolean skipCache,
@RequestParam(value = "includeSoftDelete", required = false, defaultValue = "false")
Boolean includeSoftDelete)
Boolean includeSoftDelete,
@RequestParam(value = "pitKeepAlive", required = false, defaultValue = "5m")
String pitKeepALive)
throws URISyntaxException {
EntitySpec entitySpec = entityRegistry.getEntitySpec(entityName);
@ -241,7 +243,7 @@ public abstract class GenericEntitiesController<
null,
sortCriteria,
scrollId,
null,
pitKeepALive,
count);
if (!AuthUtil.isAPIAuthorizedResult(opContext, result)) {

View File

@ -45,6 +45,7 @@ public class OpenAPIV3Generator {
private static final String NAME_VERSION = "version";
private static final String NAME_SCROLL_ID = "scrollId";
private static final String NAME_INCLUDE_SOFT_DELETE = "includeSoftDelete";
private static final String NAME_PIT_KEEP_ALIVE = "pitKeepAlive";
private static final String PROPERTY_VALUE = "value";
private static final String PROPERTY_URN = "urn";
private static final String PROPERTY_PATCH = "patch";
@ -502,6 +503,12 @@ public class OpenAPIV3Generator {
.name(NAME_SKIP_CACHE)
.description("Skip cache when listing entities.")
.schema(new Schema().type(TYPE_BOOLEAN)._default(false)),
new Parameter()
.in(NAME_QUERY)
.name(NAME_PIT_KEEP_ALIVE)
.description(
"Point In Time keep alive, accepts a time based string like \"5m\" for five minutes.")
.schema(new Schema().type(TYPE_STRING)._default("5m")),
new Parameter().$ref("#/components/parameters/PaginationCount" + MODEL_VERSION),
new Parameter().$ref("#/components/parameters/ScrollId" + MODEL_VERSION),
new Parameter().$ref("#/components/parameters/SortBy" + MODEL_VERSION),

View File

@ -146,6 +146,8 @@ public class EntityController
Boolean skipCache,
@RequestParam(value = "includeSoftDelete", required = false, defaultValue = "false")
Boolean includeSoftDelete,
@RequestParam(value = "pitKeepAlive", required = false, defaultValue = "5m")
String pitKeepALive,
@RequestBody @Nonnull GenericEntityAspectsBodyV3 entityAspectsBody)
throws URISyntaxException {
@ -202,7 +204,7 @@ public class EntityController
null,
sortCriteria,
scrollId,
null,
pitKeepALive,
count);
if (!AuthUtil.isAPIAuthorizedResult(opContext, result)) {