Extend evaluation API with GET requests #616
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Introduce both
GET /evaluation
andGET /evaluation/batch
(functionally equivalent toPOST /evaluation
andPOST /evaluation/batch
).Due to the URL length limits request query parameters were "length optimised" (instead of keeping them the same as in POST body:
enableDebug
->dbg
,flagIDs
->ids
,flagTagsOperator
~>all
, etc.). In fact, this is the main subject of the review.Evaluation entities are encoded via JSON string representation (property names are also "length optimised"):
?entity={"id":"id1","type":"t1","ctx":{"hello":"world"}}
;?entity=%7B%22id%22%3A%22id1%22%2C%22ctx%22%3A%7B%22hello%22%3A%22world%22%7D%7D
;?entity={"id":"id1","ctx":{"foo":"bar"}}&entity={"id":"id2","ctx":{"baz":"qux"}}
.This evaluation entity serialisation is used in both
/evaluation
and/evaluation/batch
routes as:/evaluation?entity={"id":"id1","ctx":{"foo":"bar"}}&id=1&key=flag-1
);All array query parameters (up to
entity
) usecollectionFormat: csv
also for "length optimisation" purpose.entity
usescollectionFormat: multi
, ascollectionFormat: csv
does not work properly for the selected encodingMotivation and Context
#613
How Has This Been Tested?
make test
make all
:Debug console
section from Flagr UI ("regress" preexisting evaluation routes);Types of changes
Checklist: