-
Notifications
You must be signed in to change notification settings - Fork 58
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
Add Unknown
type to TaskInfoType
#542
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, can you add tests? 😊
TaskInfoType
Unknown
type to TaskInfoType
Yeah, I will. This PR will get updated soon. |
I have updated this PR, to the best of my capabilities. Please review and provide feedback. |
Seems like the build failed, Can you guide me on where to look? |
@postmeback |
@postmeback there is not need for access to run the tests locally. |
I followed the steps and came up with below conclusion
Requesting you to have a look. |
@postmeback Maybe @ahmednfwela can guide you on this, or @brunoocasali who opened the issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to address the issue, we just need to configure the json serializer used by meilisearch to fallback to the unknown enum value
src/Meilisearch/MeilisearchClient.cs
Outdated
|
||
|
||
public async Task<TaskInfo> CreateUnknownTaskAsync(UnknownTaskQuery query, CancellationToken cancellationToken = default) | ||
{ | ||
var response = await _http.PostAsJsonAsync("create-unknown-task", query, Constants.JsonSerializerOptionsRemoveNulls, cancellationToken: cancellationToken) | ||
.ConfigureAwait(false); | ||
|
||
return await response.Content.ReadFromJsonAsync<TaskInfo>(cancellationToken: cancellationToken).ConfigureAwait(false); | ||
} | ||
|
||
public async Task<TaskInfo> GetTaskWithUnknownTypeAsync(GetTaskQuery query, CancellationToken cancellationToken = default) | ||
{ | ||
var response = await _http.PostAsJsonAsync("get-task-with-unknown-type", query, Constants.JsonSerializerOptionsRemoveNulls, cancellationToken: cancellationToken) | ||
.ConfigureAwait(false); | ||
|
||
return await response.Content.ReadFromJsonAsync<TaskInfo>(cancellationToken: cancellationToken).ConfigureAwait(false); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all of these are unnecessary
@@ -0,0 +1,12 @@ | |||
using System; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this new file is unnecessary
@@ -0,0 +1,13 @@ | |||
using System; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this new file is unnecessary
I have removed the unnecessary files and methods from this PR. Also, if you can point to the |
@postmeback we use the default one https://learn.microsoft.com/en-us/dotnet/api/system.text.json.serialization.jsonstringenumconverter?view=net-8.0 if this converter doesn't have a fallback option, we can create a custom one that inherits it |
check this SO question for similar solutions |
Sure, thanks for the suggestion. I will update you soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please replace the json converter annotation on top of the enum with the new converter
Done. |
bors merge |
542: Add `Unknown` type to `TaskInfoType` r=ahmednfwela a=postmeback # Pull Request ## Related issue Fixes #385 ## What does this PR do? - Currently, it adds the "Unknown" type to the enum. It requires more tasks to do ## PR checklist Please check if your PR fulfills the following requirements: - [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [x] Have you read the contributing guidelines? - [x] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: postmeback <[email protected]> Co-authored-by: Clémentine <[email protected]> Co-authored-by: Ahmed Fwela <[email protected]> Co-authored-by: Arka Poddar <[email protected]>
This PR was included in a batch that successfully built, but then failed to merge into main. It will not be retried. Additional information: {"message":"1 review requesting changes and 1 approving review by reviewers with write access.","documentation_url":"https://docs.github.com/articles/about-protected-branches","status":"422"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing my approval
bors merge
Build succeeded: |
Pull Request
Related issue
Fixes #385
What does this PR do?
PR checklist
Please check if your PR fulfills the following requirements:
Thank you so much for contributing to Meilisearch!