Skip to content

Commit

Permalink
add scroll parameters to openapi v3 spec (#10833)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin1chun authored Jul 2, 2024
1 parent 65c7adb commit b153473
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
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)
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

0 comments on commit b153473

Please sign in to comment.