You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it looks like we've updated the error format for attester. Now I need to clarify one moment. @tomholub or @martgil Please confirm that error fields(code, message, details) can not be present at the success response(HTTP code 200).
Got it. Can we change this behavior? On Android, handling cases with different logic is not simple if we are talking about implementation. IMHO, it will be better to have the same logic over all API if it is possible. To be honest, the best choice will be using JSON even for public key. Like, {"public_key":"..."}. But it seems it's not possible for the particular API.
So the question is - can we return string only for success case, and JSON for other?
Activity
tomholub commentedon Mar 13, 2023
Backendwill be removed completely in 3 monthstomholub commentedon Mar 13, 2023
That leaves
Attesterto update. can do[-]Common API error format[/-][+]Update API error format on Attester[/+]DenBond7 commentedon Apr 5, 2023
it looks like we've updated the error format for
attester. Now I need to clarify one moment. @tomholub or @martgil Please confirm that error fields(code, message, details) can not be present at the success response(HTTPcode200).tomholub commentedon Apr 5, 2023
that's correct
DenBond7 commentedon Apr 5, 2023
@tomholub I have a question. Why do we have different behavior for errors for the following requests?
https://flowcrypt.com/attester/pub/test@test.test
####################################################################################################
https://flowcrypt.com/attester/pub/test
Why do we handle them differently?
Simplified error handling. Refactored code.| #2241
Simplified error handling. Refactored code. Step 2.| #2241
Fixed tests.| #2241
tomholub commentedon Apr 5, 2023
I'm not sure - the 404 is not really an error in this case, it's a result which means "I searched the pubkey successfully, and none was found"
DenBond7 commentedon Apr 5, 2023
Got it. Can we change this behavior? On Android, handling cases with different logic is not simple if we are talking about implementation. IMHO, it will be better to have the same logic over all API if it is possible. To be honest, the best choice will be using JSON even for public key. Like,
{"public_key":"..."}. But it seems it's not possible for the particular API.So the question is - can we return string only for success case, and JSON for other?
tomholub commentedon Apr 5, 2023
I guess we could, but it would be somewhat harder to do it in a backwards compatible manner. I think it would require adding
?format=jsonor similar.DenBond7 commentedon Apr 5, 2023
Sounds good. After these changes code on my side will look much simpler and understandable for other devs.
Fixed tests. Step 2.| #2241
Added changes to ApiClientRepository.| #2241
Refactored code.| #2241
Updated tests.| #2241
Updated tests.| #2241
Refactored code.| #2241