Skip to content

Commit

Permalink
add Query parameter to membership endpoints (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdunnjpl authored Aug 15, 2024
1 parent e6e5953 commit d88c0aa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
8 changes: 8 additions & 0 deletions model/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ paths:
- $ref: "#/components/parameters/Fields"
- $ref: "#/components/parameters/Identifier"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Query"
- $ref: "#/components/parameters/Sort"
- $ref: "#/components/parameters/SearchAfter"
/products/{identifier}/members/{versions}:
Expand All @@ -302,6 +303,7 @@ paths:
- $ref: "#/components/parameters/Fields"
- $ref: "#/components/parameters/Identifier"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Query"
- $ref: "#/components/parameters/Sort"
- $ref: "#/components/parameters/SearchAfter"
- $ref: "#/components/parameters/Versions"
Expand All @@ -327,6 +329,7 @@ paths:
- $ref: "#/components/parameters/Fields"
- $ref: "#/components/parameters/Identifier"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Query"
- $ref: "#/components/parameters/Sort"
- $ref: "#/components/parameters/SearchAfter"
/products/{identifier}/members/members/{versions}:
Expand All @@ -351,6 +354,7 @@ paths:
- $ref: "#/components/parameters/Fields"
- $ref: "#/components/parameters/Identifier"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Query"
- $ref: "#/components/parameters/Sort"
- $ref: "#/components/parameters/SearchAfter"
- $ref: "#/components/parameters/Versions"
Expand All @@ -376,6 +380,7 @@ paths:
- $ref: "#/components/parameters/Fields"
- $ref: "#/components/parameters/Identifier"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Query"
- $ref: "#/components/parameters/Sort"
- $ref: "#/components/parameters/SearchAfter"
/products/{identifier}/member-of/{versions}:
Expand All @@ -400,6 +405,7 @@ paths:
- $ref: "#/components/parameters/Fields"
- $ref: "#/components/parameters/Identifier"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Query"
- $ref: "#/components/parameters/Sort"
- $ref: "#/components/parameters/SearchAfter"
- $ref: "#/components/parameters/Versions"
Expand All @@ -425,6 +431,7 @@ paths:
- $ref: "#/components/parameters/Fields"
- $ref: "#/components/parameters/Identifier"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Query"
- $ref: "#/components/parameters/Sort"
- $ref: "#/components/parameters/SearchAfter"
/products/{identifier}/member-of/member-of/{versions}:
Expand All @@ -449,6 +456,7 @@ paths:
- $ref: "#/components/parameters/Fields"
- $ref: "#/components/parameters/Identifier"
- $ref: "#/components/parameters/Limit"
- $ref: "#/components/parameters/Query"
- $ref: "#/components/parameters/Sort"
- $ref: "#/components/parameters/SearchAfter"
- $ref: "#/components/parameters/Versions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ private PdsLidVid resolveIdentifierToLidvid(PdsProductIdentifier identifier) thr

@Override
public ResponseEntity<Object> productMembers(
String identifier, List<String> fields, Integer limit, List<String> sort, List<String> searchAfter)
String identifier, List<String> fields, Integer limit, String q, List<String> sort, List<String> searchAfter)
throws NotFoundException, UnhandledException, SortSearchAfterMismatchException, BadRequestException,
AcceptFormatNotSupportedException{

Expand All @@ -433,7 +433,7 @@ public ResponseEntity<Object> productMembers(
}

SearchRequest searchRequest = searchRequestBuilder
.applyMultipleProductsDefaults(fields, "", List.of(), limit, sort, searchAfter, true)
.applyMultipleProductsDefaults(fields, q, List.of(), limit, sort, searchAfter, true)
.build();

SearchResponse<HashMap> searchResponse =
Expand All @@ -450,7 +450,7 @@ public ResponseEntity<Object> productMembers(

@Override
public ResponseEntity<Object> productMembersMembers(
String identifier, List<String> fields, Integer limit, List<String> sort, List<String> searchAfter)
String identifier, List<String> fields, Integer limit, String q, List<String> sort, List<String> searchAfter)
throws NotFoundException, UnhandledException, SortSearchAfterMismatchException, BadRequestException,
AcceptFormatNotSupportedException{

Expand All @@ -470,7 +470,7 @@ public ResponseEntity<Object> productMembersMembers(
}

SearchRequest searchRequest = searchRequestBuilder
.applyMultipleProductsDefaults(fields, "", List.of(), limit, sort, searchAfter, true)
.applyMultipleProductsDefaults(fields, q, List.of(), limit, sort, searchAfter, true)
.build();

SearchResponse<HashMap> searchResponse =
Expand Down Expand Up @@ -523,7 +523,7 @@ private List<PdsLidVid> resolveLidVidsFromProductField(PdsProductIdentifier iden

@Override
public ResponseEntity<Object> productMemberOf(
String identifier, List<String> fields, Integer limit, List<String> sort, List<String> searchAfter)
String identifier, List<String> fields, Integer limit, String q, List<String> sort, List<String> searchAfter)
throws NotFoundException, UnhandledException, SortSearchAfterMismatchException, BadRequestException,
AcceptFormatNotSupportedException, UnparsableQParamException {

Expand All @@ -543,7 +543,7 @@ public ResponseEntity<Object> productMemberOf(
}

SearchRequest searchRequest = new RegistrySearchRequestBuilder(this.connectionContext)
.applyMultipleProductsDefaults(fields, "", List.of(), limit, sort, searchAfter, true)
.applyMultipleProductsDefaults(fields, q, List.of(), limit, sort, searchAfter, true)
.matchFieldAnyOfIdentifiers("_id", parentIds)
.build();

Expand All @@ -561,7 +561,7 @@ public ResponseEntity<Object> productMemberOf(

@Override
public ResponseEntity<Object> productMemberOfOf(
String identifier, List<String> fields, Integer limit, List<String> sort, List<String> searchAfter)
String identifier, List<String> fields, Integer limit, String q, List<String> sort, List<String> searchAfter)
throws NotFoundException, UnhandledException, SortSearchAfterMismatchException, BadRequestException,
AcceptFormatNotSupportedException, UnparsableQParamException {

Expand All @@ -580,7 +580,7 @@ public ResponseEntity<Object> productMemberOfOf(
}

SearchRequest searchRequest = new RegistrySearchRequestBuilder(this.connectionContext)
.applyMultipleProductsDefaults(fields, "", List.of(), limit, sort, searchAfter, true)
.applyMultipleProductsDefaults(fields, q, List.of(), limit, sort, searchAfter, true)
.matchFieldAnyOfIdentifiers("_id", parentIds)
.build();

Expand Down

0 comments on commit d88c0aa

Please sign in to comment.