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
Changes from 1 commit
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 @@ -57,6 +57,8 @@ 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 SKIP_CACHE = "skipCache";
private static final String INCLUDE_DELETED = "includeDeleted";

public static OpenAPI generateOpenApiSpec(EntityRegistry entityRegistry) {
final Set<String> aspectNames = entityRegistry.getAspectSpecs().keySet();
Expand Down Expand Up @@ -249,9 +251,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(INCLUDE_DELETED)
.description("Include soft-deleted aspects with response.")
.schema(new Schema().type(TYPE_BOOLEAN)._default(false)),
new Parameter()
.in(NAME_QUERY)
.name(SKIP_CACHE)
.description("Skip cache when listing entities.")
.schema(new Schema().type(TYPE_BOOLEAN)._default(false)),
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

Method buildListEntityPath not updated with new parameters

The method buildListEntityPath in the following files has not been updated to include the new parameters INCLUDE_DELETED and SKIP_CACHE:

  • entity-registry/src/test/java/com/linkedin/metadata/models/OpenApiSpecBuilderTest.java
  • metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/v3/OpenAPIV3Generator.java
  • buildSrc/src/main/java/io/datahubproject/OpenApiEntities.java

Please ensure that all occurrences of buildListEntityPath are updated to handle these new parameters to prevent potential issues.

Analysis chain

LGTM! But verify the method usage in the codebase.

The changes to include INCLUDE_DELETED and SKIP_CACHE parameters in the buildListEntityPath method are approved.

However, ensure that all calls to buildListEntityPath are updated to handle these new parameters.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify all calls to `buildListEntityPath` are updated to handle the new parameters.

# Test: Search for the method usage. Expect: Only occurances of the updated method signature.
rg --type java $'buildListEntityPath'

Length of output: 1167



Script:

#!/bin/bash
# Description: Check the method signatures of `buildListEntityPath` in the identified files to see if they include the new parameters.

# Check the method signature in OpenApiSpecBuilderTest.java
echo "Checking OpenApiSpecBuilderTest.java:"
rg --pcre2 --context 5 'private PathItem buildListEntityPath' entity-registry/src/test/java/com/linkedin/metadata/models/OpenApiSpecBuilderTest.java

# Check the method signature in OpenAPIV3Generator.java
echo "Checking OpenAPIV3Generator.java:"
rg --pcre2 --context 5 'private static PathItem buildListEntityPath' metadata-service/openapi-servlet/src/main/java/io/datahubproject/openapi/v3/OpenAPIV3Generator.java

# Check the method signature in OpenApiEntities.java
echo "Checking OpenApiEntities.java:"
rg --pcre2 --context 5 'private ObjectNode buildListEntityPath' buildSrc/src/main/java/io/datahubproject/OpenApiEntities.java

Length of output: 2186

new Parameter()
.$ref(
String.format(
Expand Down
Loading