Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add scroll parameters to openapi v3 spec #10833

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ public ResponseEntity<S> getEntities(
Boolean withSystemMetadata,
@RequestParam(value = "skipCache", required = false, defaultValue = "false")
Boolean skipCache,
@RequestParam(value = "includeSoftDeleted", required = false, defaultValue = "false")
Boolean includeSoftDeleted)
@RequestParam(value = "includeSoftDelete", required = false, defaultValue = "false")
Boolean includeSoftDelete)
Comment on lines +151 to +152
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Ensure all instances of includeSoftDeleted are updated to includeSoftDelete.

The parameter name change has not been consistently applied across the codebase. The following files still reference includeSoftDeleted and need to be updated:

  • metadata-service/restli-client/src/main/java/com/linkedin/entity/client/RestliEntityClient.java
  • metadata-service/services/src/main/java/com/linkedin/metadata/systemmetadata/SystemMetadataService.java
  • metadata-io/src/main/java/com/linkedin/metadata/entity/validation/ValidationUtils.java
  • metadata-io/src/main/java/com/linkedin/metadata/entity/EntityServiceImpl.java
  • metadata-io/src/main/java/com/linkedin/metadata/systemmetadata/ElasticSearchSystemMetadataService.java
  • metadata-io/src/main/java/com/linkedin/metadata/systemmetadata/ESSystemMetadataDAO.java
  • datahub-graphql-core/src/test/java/com/linkedin/datahub/graphql/resolvers/assertion/EntityAssertionsResolverTest.java
  • datahub-graphql-core/src/main/java/com/linkedin/datahub/graphql/resolvers/assertion/EntityAssertionsResolver.java
Analysis chain

Verify the impact of the parameter name change.

The parameter name has been updated from includeSoftDeleted to includeSoftDelete. Ensure that all references to this parameter in the codebase are updated accordingly to prevent any potential issues.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify all references to the parameter `includeSoftDeleted` are updated to `includeSoftDelete`.

# Test: Search for the old parameter name. Expect: No occurrences of `includeSoftDeleted`.
rg --type java $'includeSoftDeleted'

Length of output: 6078

throws URISyntaxException {

EntitySpec entitySpec = entityRegistry.getEntitySpec(entityName);
Expand Down Expand Up @@ -178,7 +178,7 @@ public ResponseEntity<S> getEntities(
opContext
.withSearchFlags(flags -> DEFAULT_SEARCH_FLAGS)
.withSearchFlags(flags -> flags.setSkipCache(skipCache))
.withSearchFlags(flags -> flags.setIncludeSoftDeleted(includeSoftDeleted)),
.withSearchFlags(flags -> flags.setIncludeSoftDeleted(includeSoftDelete)),
List.of(entitySpec.getName()),
query,
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class OpenAPIV3Generator {
private static final String ASPECT_RESPONSE_SUFFIX = "Aspect" + RESPONSE_SUFFIX;
private static final String ENTITY_REQUEST_SUFFIX = "Entity" + REQUEST_SUFFIX;
private static final String ENTITY_RESPONSE_SUFFIX = "Entity" + RESPONSE_SUFFIX;
private static final String NAME_SKIP_CACHE = "skipCache";

public static OpenAPI generateOpenApiSpec(EntityRegistry entityRegistry) {
final Set<String> aspectNames = entityRegistry.getAspectSpecs().keySet();
Expand Down Expand Up @@ -249,9 +250,19 @@ private static PathItem buildListEntityPath(final EntitySpec entity) {
List.of(
new Parameter()
.in(NAME_QUERY)
.name("systemMetadata")
.name(NAME_SYSTEM_METADATA)
.description("Include systemMetadata with response.")
.schema(new Schema().type(TYPE_BOOLEAN)._default(false)),
new Parameter()
.in(NAME_QUERY)
.name(NAME_INCLUDE_SOFT_DELETE)
.description("Include soft-deleted aspects with response.")
.schema(new Schema().type(TYPE_BOOLEAN)._default(false)),
new Parameter()
.in(NAME_QUERY)
.name(NAME_SKIP_CACHE)
.description("Skip cache when listing entities.")
.schema(new Schema().type(TYPE_BOOLEAN)._default(false)),
new Parameter()
.$ref(
String.format(
Expand Down
Loading