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

feature: 420 fix filterExpression #476

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 @@ -27,15 +27,15 @@
* EdcContractAgreementRequest represents the request to management/v2/contractagreements/request
*/
public record EdcContractAgreementRequest(@JsonProperty(
"https://w3id.org/edc/v0.0.1/ns/filterExpression") List<EdcContractAgreementFilterExpression> edcContractAgreementFilterExpressions) {
"https://w3id.org/edc/v0.0.1/ns/filterExpression") EdcContractAgreementFilterExpression edcContractAgreementFilterExpressions) {
/**
* EdcContractAgreementFilterExpression represents the filterExpression
* for EdcContractAgreementRequest
*/
public record EdcContractAgreementFilterExpression(
@JsonProperty("https://w3id.org/edc/v0.0.1/ns/operandLeft") String operandLeft,
@JsonProperty("https://w3id.org/edc/v0.0.1/ns/operator") String operator,
@JsonProperty("https://w3id.org/edc/v0.0.1/ns/operandRight") String operandRight) {
@JsonProperty("https://w3id.org/edc/v0.0.1/ns/operandRight") List<String> operandRight) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,10 @@ public EdcContractAgreementNegotiationResponse getContractAgreementNegotiation(f

private EdcContractAgreementRequest buildContractAgreementRequest(final List<String> contractAgreementIds) {

final List<EdcContractAgreementFilterExpression> list = contractAgreementIds.stream()
.map(s -> new EdcContractAgreementFilterExpression(
EDC_CONTRACT_AGREEMENT_ID, "=", s))
.toList();
final EdcContractAgreementFilterExpression edcContractAgreementFilterExpression = new EdcContractAgreementFilterExpression(
EDC_CONTRACT_AGREEMENT_ID, "in", contractAgreementIds);

return new EdcContractAgreementRequest(list);
return new EdcContractAgreementRequest(edcContractAgreementFilterExpression);
}

private HttpHeaders headers() {
Expand Down
Loading