-
Notifications
You must be signed in to change notification settings - Fork 1
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
error calling EditFacts for multiple facts #63
Comments
Hello @amit-boi , thanks for the report. In the EditFacts method, the patch can only be a single object. That is what the not so friendly error is trying to tell you. The patch object is merged into each identified fact as a result of the method call so it must be one. In the C# bindings bodies are defined as object and toString is invoked as necessary. What is the intended behaviour when you pass multiple patch objects? Kind regards, |
I want to update all the objects in one call in order to improve performance. |
Hello @amit-boi, to update more than one fact at the same time you don't need to pass multiple patches. To do so we can: Body: This part of the request identifies the facts (all the facts from open_table that are marked as invalid): xbrl28:Archive=open_table&open=true&boi:FilingStatus=invalid Are you trying to patch each object with a different patch? Let me know if this helps, |
Yes. |
Hello @amit-boi, The behaviour of the method is: Thanks and kind regards, |
If the value of every patch is diffrent and it's for diffrent fact then i think i need diffrent patches. Anyway, I am trying to do editFacts in parallel threads for high number of facts and is seems to solve the performance issue. |
If you want to apply different patches to different facts you need to make multiple requests at the moment. If you pass multiple patches in the same call on every identified fact all patches are applied in order. |
i did not understand your second sentence. can you show me an example ? |
Hi,
I am trying to edit multiple facts together using this code:
dataAPI.EditFacts(token: rwtoken, patch: patch, aid: aid, dimensions: dimensions);
If patch type is List of Fact class i recive the error message listed below.
If patch type is Fact the operation is successfull.
Error calling EditFacts: { "request_id" : "57b45337d38b6126b73b07ae", "context" : "boi.local.28.io", "type" : "type", "code" : "XPTY0004", "location" : { "module" : "/public/api/facts/PATCH.jq", "line-number" : 69, "line-number-end" : 69, "column-number" : 5, "column-number-end" : 86 }, "description" : "array() can not be treated as type object()", "message" : "</public/api/facts/PATCH.jq>:69,5: type error [err:XPTY0004]: array() can not be treated as type object()" }
Fact class is:
public class Fact
{
public List KeyAspects { get; set; }
public Dictionary<string, string> Aspects { get; set; }
public Profiles Profiles { get; set; }
public string Value { get; set; }
public int Decimals { get; set; }
public List AuditTrails { get; set; }
}
The text was updated successfully, but these errors were encountered: