I am not sure if this is the right category but here it goes, I created a pull request for manticoresearch-java project. Basically it looks like it cannot parse a response containing ‘warning’ field. It was in September so I was wondering if there are any plans to check it out anytime soon?
The problem is that the java client and most other modern clients (except for php and go) are generated automatically through OpenAPI generator, so it’s not that straightforward to just accept the pull request and apply your change. Instead, we need to think how to make sure the change gets applied through OpenAPI generator. What we probably need to do is make the OpenAPI generation part of the clients public. Would you be willing to look into it then to try to apply your change the way it’s not lost when we regenerate the client?
thanks for the reply. Yes, that’s the correct PR. If you would expose the client generation part I would be willing to take a look at it but I make no promises
so I’ve tried it locally before even adding warning field definition to the manticore.yml file and it appears that generating Java client produces broken equals/hashCode methods across Java classes.
I have run the generator with : ./build.sh java v5.0.0 command.
Example: @Override
public int hashCode() {
return Objects.hash(tooktimedOutaggregationshitsprofile); // concatenated variables?
}
I have read in your docs that you have used v5.0.0 generator so before I start analyzing further could you maybe tell me if you stumbled on something like this?
Also, I have noticed some minor errors I would say, like:
manticore.json is not synced with manticore.yml
e.g. missing aggregations so remove this file maybe?
build.sh will not run on macOs
e.g. rm out/manticoresearch-java -rf fails due to the order of option/flags
Other than that, igoring the issue with equals/hashCode when I added warning field definition to manticore.yml the generated code looked ok. Are you ok with warning field definition to be given as
warning:
type: object
additionalProperties: true
or would you prefer a dedicated object with schema?
Thanks. I did try it and the code was generated. However, my code which was previously working is now failing.
It fails on UtilsApi.sql call saying that the query is missing.
At first glance, it’s unclear why the generation with the warning field added leads to such fail. Unfortunately, it’ll take some time before we start looking into this issue, so, if you want, you can try investigating it on your own - it may be quicker.
I have been digging a little bit and it seems that commit 075487519511d22d01e5811e76c31c5b1919e4d9 introduced the problem (switch to jersey2). ApiClient#serialize method else part of the statement wraps string within double quotes which breaks sql query definition. I guess this is the reason why query=… can’t be deconstructed to name and value which in turn results in error message → query missing. Exact lines are 678 and 684.
Here is the description of the problem I mentioned in the post above. I am using InsertDocumentRequest and the exception thrown is:
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "status" (class com.manticoresearch.client.model.SuccessResponse), not marked as ignorable (5 known properties: "created", "_id", "_index", "result", "found"])
at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 80] (through reference chain: com.manticoresearch.client.model.SuccessResponse["status"])
The reason why this is happening now is that the older version contained @JsonIgnoreProperties(ignoreUnknown = true) which prevented the above exception from being thrown.