-
Notifications
You must be signed in to change notification settings - Fork 31
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
Reorganize analyzer properties #450
Conversation
tjoubert
commented
Dec 21, 2022
•
edited
Loading
edited
- Got rid of the generic AnalyzerProperties class
- Implemented a custom properties class for each specific analyzer type
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.
Good idea to refactor into separate classes for analyzer properties 👍
I left a few minor comments. One thing I want to discuss before merging:
With this new approach, analyzer properties will not be available from Analyzer
objects returned by API methods (e.g. PostAnalyzerAsync
, GetAnalyzerAsync
or GetAllAnalyzersAsync
). Only an empty AnalyzerPropertiesBase
object will be available. The serializer has no way at the moment to know what derived type to create when deserializing.
Is it expected?
A workaround is to instruct the serializer to construct a derived type based on the Analyzer.Type
property, e.g. using a converter. However any serializer specific logic should be carefully reviewed because the library allows overriding the serializer, so someone may use System.Text.Json
or any other.
Perhaps we should think a bit more about this approach? For now, I propose to:
- Close this pull request
- Open a new pull request to fix the bug by simply adding the properties on the existing
AnalyzerProperties
object. - Open a new issue to refactor the properties like you did, which will give some more time to think about. We can link this pull request on the issue.
What do you think?
Also, isn't it a breaking change as we are changing the way analyzer properties are provided? Probably all the more reasons to hold off until the next major release. I've added the "breaking change" label.
arangodb-net-standard/AnalyzerApi/Models/AnalyzerProperties/GeoJSONAnalyzerOptions.cs
Outdated
Show resolved
Hide resolved
arangodb-net-standard/AnalyzerApi/Models/AnalyzerProperties/AnalyzerPropertiesBase.cs
Outdated
Show resolved
Hide resolved
arangodb-net-standard/AnalyzerApi/Models/AnalyzerProperties/GeoJSONAnalyzer.cs
Outdated
Show resolved
Hide resolved
arangodb-net-standard/AnalyzerApi/Models/AnalyzerProperties/NearestNeighborsAnalyzer.cs
Outdated
Show resolved
Hide resolved
arangodb-net-standard/AnalyzerApi/Models/AnalyzerProperties/TextAnalyzerEdgeNgram.cs
Outdated
Show resolved
Hide resolved
@DiscoPYF , you are right. In order to merge this PR correctly, we would need serializer-specific logic to deserialize the |
Import changes from master to branch DE-448
@DiscoPYF, I have revived this PR for your review (our discussions). Here's the update:
|