Skip to content

Sync Swagger with code and 2 enhancements #127

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

Merged
merged 2 commits into from
Aug 22, 2019
Merged

Sync Swagger with code and 2 enhancements #127

merged 2 commits into from
Aug 22, 2019

Conversation

callmekatootie
Copy link
Contributor

  1. Update Swagger to be in sync with the code Fix issues found during submission api wrapper contest #113
  2. Provide sortyBy parameter when querying Need sortBy param for submissions endpoint #124
  3. Change which attribute is used to name artifacts in submissions Change the name of the artifact #125

2. Provide sortyBy parameter when querying #124
3. Change which attribute is used to name artifacts in submissions #125
…as the artifact name

2. Prevent sort by name for review type (text field cannot be sorted in ES)
@callmekatootie callmekatootie changed the title WIP: DONT MERGE YET Sync Swagger with code and 2 enhancements Aug 18, 2019
@callmekatootie
Copy link
Contributor Author

callmekatootie commented Aug 18, 2019

@cwdcwd Let me know if I can merge this one. Please note the following:

Sort order default changed
- BEFORE: For submission resource alone, internally, we sort by created field, in ascending order. Other resources had no internal sort in place
- AFTER: For all resources (except review type, which does not have timestamps), internally sort by updated field, in descending order (also accepts explicit sort by other fields too)

Scorecard ID
- BEFORE: Across all resources, joi validation would allow string and number (but ES would throw error expecting it to be a number)
- AFTER: joi validation updated to enforcing this only to be a number

Sorting on text fields

  • Review Type's name attribute is a text field in ES. However, sorting using this field throws the below error from ES:
{
    "message": "[illegal_argument_exception] Fielddata is disabled on text fields by default. Set fielddata=true on [name] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."
}

More information on this error can be found here. So, in review type, you cannot sort with name attribute for the moment.

Artifacts

  • BEFORE: We used the artifact type id (which used to be the review type id) as the name of the artifact
  • AFTER: We no longer accept the artifact type id. The artifact name is the filename itself (the artifact file that was uploaded - its name)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants