-
Notifications
You must be signed in to change notification settings - Fork 16
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 'returnDocumentResponses' for "insertMany" #1161
Conversation
src/main/java/io/stargate/sgv2/jsonapi/api/model/command/CommandStatus.java
Outdated
Show resolved
Hide resolved
…urnDocumentResponses)
@@ -46,7 +46,7 @@ public record CommandResult( | |||
nullable = true) | |||
}) | |||
Map<CommandStatus, Object> status, | |||
@Schema(nullable = true) List<Error> errors) { | |||
@JsonInclude(JsonInclude.Include.NON_EMPTY) @Schema(nullable = true) List<Error> errors) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding this so that both null
and [ ]
values are skipped (not just nulls)
} | ||
|
||
private static CommandResult.Error getError(DocumentId documentId, Throwable throwable) { | ||
String message = | ||
"Failed to insert document with _id %s: %s".formatted(documentId, throwable.getMessage()); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code was not being used, not sure why it was there (ThrowableToErrorMapper handles this logic)
@@ -18,12 +16,10 @@ | |||
public class InsertManyCommandResolver implements CommandResolver<InsertManyCommand> { | |||
|
|||
private final Shredder shredder; | |||
private final ObjectMapper objectMapper; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was not being used, removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
src/main/java/io/stargate/sgv2/jsonapi/service/operation/model/impl/InsertOperation.java
Show resolved
Hide resolved
src/main/java/io/stargate/sgv2/jsonapi/service/operation/model/impl/InsertOperationPage.java
Outdated
Show resolved
Hide resolved
src/main/java/io/stargate/sgv2/jsonapi/service/operation/model/impl/InsertOperationPage.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What this PR does:
Adds support for requesting returning of doc ids of successful and failed inserts with "insertMany" command
Which issue(s) this PR fixes:
N/A
Checklist