Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I would say write two mapping functions and an injector that serves them keyed off the api version.
But, given they don't seem to have static schemas, they probably also don't have API versions. -
donuts236725y@olback how? You have 2 list of objects, different orders. Though I guess if we modify both versions to sort the results by Id that'd work for this specific case.
Sorting after db is hard, some results are huge...
But actually just realized for my case all I need to check is the IDs are the same... -
@billgates maybe? http://www.jsondiff.com/
if commandline is more your thing
https://github.com/andreyvit/...
There is probably a function in jsonlint in the vscode extension or vscode itself.
Related Rants
I need to compare the JSON results of an API before and after a code change. But it was also moved to another API.
However some fields are auto-generated like timestamp or derived off the url (resource links).
Also if a JSON list is returned it maybe in different order...
Wondering is there a quick way to test text likeness?
I've done it before but just used matching status code and maybe measuring the diff in response size
question
algorithm