Closed thomasheartman closed 6 months ago
Ah, there is one edge case that I can think of, actually: Deserializing empty string properties.
I noticed that the base Context type is defined with a custom deserializer:
deserialize_with = "remove_null_properties",
With the new extra_properties, these can be empty strings. Should they be stripped out in any way when deserializing?
(Also: added a test for the invalid properties value giving 400 as mentioned in the previous PR)
Update all endpoints of the frontend_api to accept top-level properties.
This is primarily just changing the type we expect and then, on the lower level functions, converting the incoming context into a regular context.
Most of the functions are pretty straight-forward.
get_all_features
appears to be the only one that doesn't share an implementation with any other functions.The tests check:
/api/frontend/features/:feature
(/api/proxy/features/:feature
uses the same impl under the hood, so I've not tested that explicitly. Happy to change that though./api/{frontend,proxy}(/all)?
/api/{frontend,proxy)
(POST all features function takes anIncomingContext
as a parameter, so I'm assuming the serialization here works; can of course add tests for that too)properties
yields a 400Are there any more endpoints to update? Any other input?