Skip to content

Conversation

@eigenpaul
Copy link
Member

@eigenpaul eigenpaul commented Dec 17, 2024

Improvement to #37 so that an existing index always gets the correct mediaType as well

Signed-off-by: Paul Hildebrandt <[email protected]>
try:
self._check_200_response(response)
index = response.json()
# Ensure mediaType is set for existing indices
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would at least encourage you to validate if a mediaType is available at the response before overwriting it. In general the method is called get_index(). Manipulating the index in this context seems like an unwanted side-effect.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, this should really been in update_index(). I'll also check if it's available first.

@eigenpaul eigenpaul closed this Dec 19, 2024
@eigenpaul eigenpaul deleted the mediatype-for-existing-index branch December 19, 2024 15:01
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.

3 participants