This repository has been archived by the owner on May 6, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements recent changes made to the schemas on challenge filtering and sorting. This PR also implements the changes suggested in this PR.
Swagger UI tips
Example of selecting multiple values in Swagger UI. Unfortunately, it's not possible to deselect the items. Selecting
--
will result in the select of an empty value, which in this example, will trigger an error because an empty string is not a valid challenge status. A solution is to refresh the Swagger UI page.Filtering
topics
keeps the challenges that have at least one topic specifiedstatus
keeps the challenges that have their status equal to one of the status values specifiedplatformId
keeps the challenges that have their platform id equal to one of the platform ids specifieddifficulty
keeps the challenges that have their difficulty level set to one of the values specifiedinputDataTypes
keeps the challenges that have at least one of the input data types specifiedsubmissionTypes
keeps the challenges that have at least one of the submission types specifiedincentiveTypes
keeps the challenges that have at least one of the incentive types specifiedstarDateRange
(object) keeps the challenges that have their start date inside the date range specifiedorgIds
keeps the challenges organized by the orgs specifiedownerId
included in the listorgIds
specified.Challenge.fullName
starts with one of the org logins specified. For now I preferred during the comparison with org ids instead of org logins because it's more consistent with other filters (e.g. search by platform ids) and is easier to implement.organizerIds
keeps the challenges organized by the organizers specified (organizer must be a User)sponsorIds
keeps the challenges organized by the sponsors specified (sponsor must be an Organization)Filtering by organizers and sponsors
The filtering could be done using ids or name. The former would results in a better user experience and contributes to reduce the issue of of homonyms by showing to the user additional information about the selected organizers or sponsors like their picture, affiliation for the organizers, etc. One potential drawback is that the organizers and sponsors must have User or Org account in the registry. If the registry is widely adopted by the community, this limitation would decrease as the number of User and Org account increases. This first approach could also be an incentive to organizers and sponsors to create an account.
The second solution is for the user to type a name and for the registry to then show a list of matching names from the list of all challenge organizers, for instance. Because an organizer who organize two challenges would appear twice in this list, the filter behavior would only make sense if we show the user a list of unique names (i.e. aggregate identical name). Therefore the organizer options shown to the user are "string" in this second approach, while their were "User" in the first approach. The "string" has less information than a "User" object and so it would not be possible (or rather difficult) to show information about organizer affiliation, avatar, etc. The benefit of this solution is that it enables to search organizers or sponsors that have not created account in the registry.
Sorting
featured - desc
displays the featured challenges firststartDate - desc
displays the challenges starting from the one that start lastparticipantCount - desc
displays the challenges starting from the one with the largest participant countviewCount - desc
displays the challenges starting from the one with the largest view countstarredCount - desc
displays the challenges starting from the one that has been starred the moststarredCount
with the content of the collectionstarred_challenge
OR rely only on the collectionstarred_challenge
name - desc
displays the challenges in alphabetical order by theirname
createdAt -desc
displays the challenges starting from the one created the most recentlyupdatedAt - desc
displays the challenges starting from the one updated the most recently