Skip to content

Fix type field #12

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 3 commits into from
Jul 21, 2025
Merged

Fix type field #12

merged 3 commits into from
Jul 21, 2025

Conversation

bilalebi
Copy link
Contributor

This API call: https://resolver.ensembl.org/id/ENSAROG00010015245
Causes the resolver to throw:

│ pydantic_core._pydantic_core.ValidationError: 1 validation error for ResolvedPayload                                                                                                                        
│ type                                                                                                                                                                                                        
│  Input should be a valid string [type=string_type, input_value={'kind': 'strain', 'value': 'reference'}, input_type=dict]

Because it's expecting type field to be a string but it's getting a dictionary {'kind': 'strain', 'value': 'reference'}

To fix it, I changed

type: Optional[str] = None
# to
type: Optional[Dict[str, str]] = None

@bilalebi bilalebi requested a review from azangru July 17, 2025 13:58
@azangru
Copy link

azangru commented Jul 18, 2025

If the resolver finds multiple matches, it renders an html page where it shows a list of them, with links.

What can now be seen on this html page is that:

  • The type information gets rendered as a stringified json
  • It also is placed in the Resolved URL column rather than in the Type column, where it belongs
image

This calls for an update in this html file:

https://github.com/Ensembl/ensembl-web-resolver/blob/main/app/api/resources/templates/search_results.html#L24

@bilalebi
Copy link
Contributor Author

Fixed now and added is_reference logic as well
Here is the example that was broken: https://resolver.ensembl.org/id/ENSAROG00010015245
image

Another example that was working but had None in Type: https://resolver.ensembl.org/id/ENSG00000127720
image

@bilalebi bilalebi merged commit bc98e70 into main Jul 21, 2025
@azangru azangru deleted the fix-type-field branch July 21, 2025 09:48
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