Clear rules/synoyms when empty batch is provided with clear existing
When the input is empty no batches are sent which led to keeping the existing rules/synonyms.
The expected behaviour is to clear the existing rules/synonyms.
Since the API rejected empty batches, the clear endpoint is required for this specific case.
Disable clear existing after the first batch
If the input contains more than 1000 items, the cli splits the input into several batches but if the flag ClearExistingRules/ReplaceExistingSynonyms is provided, only the last batch will be kept.
This PR set the flag only for the first batch.
Summary
This PR contains 2 fixes:
Clear rules/synoyms when empty batch is provided with clear existing
When the input is empty no batches are sent which led to keeping the existing rules/synonyms. The expected behaviour is to clear the existing rules/synonyms. Since the API rejected empty batches, the clear endpoint is required for this specific case.
Disable clear existing after the first batch
If the input contains more than 1000 items, the cli splits the input into several batches but if the flag
ClearExistingRules
/ReplaceExistingSynonyms
is provided, only the last batch will be kept. This PR set the flag only for the first batch.Test strategy
unit tests has been added to test both fixes