dexter submitted this change.

View Change

Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve dexter: Looks good to me, approved
esipa_json_handler: use atoms as JSON field names

It is sufficient to use atoms as JSON fieldnames. It is not necessary
to write the field names as binaries. When using atoms, the code is
much easier to read.

Related: SYS#8203
Change-Id: I14edb8f60c755dfc8940015fe7c3436fa14e32b1
---
M src/esipa_json_handler.erl
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/esipa_json_handler.erl b/src/esipa_json_handler.erl
index 6e55675..aad3929 100644
--- a/src/esipa_json_handler.erl
+++ b/src/esipa_json_handler.erl
@@ -93,7 +93,7 @@
{initiateAuthenticationOkEsipa, InitiateAuthenticationOkEsipa}} ->
join([
{header, #{
- <<"functionExecutionStatus">> => #{<<"status">> => <<"Executed-Success">>}
+ functionExecutionStatus => #{status => <<"Executed-Success">>}
}},
{transactionId,
to_hex(maps:get(transactionId, InitiateAuthenticationOkEsipa, absent))},
@@ -146,7 +146,7 @@
{authenticateClientOkDPEsipa, AuthenticateClientOkDPEsipa}} ->
join([
{header, #{
- <<"functionExecutionStatus">> => #{<<"status">> => <<"Executed-Success">>}
+ functionExecutionStatus => #{status => <<"Executed-Success">>}
}},
{transactionId,
to_hex(maps:get(transactionId, AuthenticateClientOkDPEsipa, absent))},
@@ -201,7 +201,7 @@
{getBoundProfilePackageOkEsipa, GetBoundProfilePackageOkEsipa}} ->
join([
{header, #{
- <<"functionExecutionStatus">> => #{<<"status">> => <<"Executed-Success">>}
+ functionExecutionStatus => #{status => <<"Executed-Success">>}
}},
{transactionId,
to_hex(maps:get(transactionId, GetBoundProfilePackageOkEsipa, absent))},
@@ -265,7 +265,7 @@
{getEimPackageResponse, {euiccPackageRequest, EuiccPackageRequest}} ->
join([
{header, #{
- <<"functionExecutionStatus">> => #{<<"status">> => <<"Executed-Success">>}
+ functionExecutionStatus => #{status => <<"Executed-Success">>}
}},
{euiccPackageRequest,
to_base64asn1(
@@ -275,7 +275,7 @@
{getEimPackageResponse, {ipaEuiccDataRequest, IpaEuiccDataRequest}} ->
join([
{header, #{
- <<"functionExecutionStatus">> => #{<<"status">> => <<"Executed-Success">>}
+ functionExecutionStatus => #{status => <<"Executed-Success">>}
}},
{ipaEuiccDataRequest,
to_base64asn1(
@@ -285,7 +285,7 @@
{getEimPackageResponse, {profileDownloadTriggerRequest, ProfileDownloadTriggerRequest}} ->
join([
{header, #{
- <<"functionExecutionStatus">> => #{<<"status">> => <<"Executed-Success">>}
+ functionExecutionStatus => #{status => <<"Executed-Success">>}
}},
{profileDownloadTriggerRequest,
to_base64asn1(
@@ -310,7 +310,7 @@
end,
join([
{header, #{
- <<"functionExecutionStatus">> => #{<<"status">> => <<"Executed-Success">>}
+ functionExecutionStatus => #{status => <<"Executed-Success">>}
}},
{eimPackageError, EimPackageErrorInt}
]);
@@ -334,7 +334,7 @@
{provideEimPackageResultResponse, {eimAcknowledgements, EimAcknowledgements}} ->
join([
{header, #{
- <<"functionExecutionStatus">> => #{<<"status">> => <<"Executed-Success">>}
+ functionExecutionStatus => #{status => <<"Executed-Success">>}
}},
{eimAcknowledgements,
to_base64asn1(
@@ -344,7 +344,7 @@
{provideEimPackageResultResponse, {emptyResponse, #{}}} ->
join([
{header, #{
- <<"functionExecutionStatus">> => #{<<"status">> => <<"Executed-Success">>}
+ functionExecutionStatus => #{status => <<"Executed-Success">>}
}}
]);
{provideEimPackageResultError,
@@ -377,7 +377,7 @@
emptyResponse ->
join([
{header, #{
- <<"functionExecutionStatus">> => #{<<"status">> => <<"Executed-Success">>}
+ functionExecutionStatus => #{status => <<"Executed-Success">>}
}}
]);
_ ->
@@ -402,7 +402,7 @@
{cancelSessionResponseEsipa, {cancelSessionOk, _CancelSessionOk}} ->
join([
{header, #{
- <<"functionExecutionStatus">> => #{<<"status">> => <<"Executed-Success">>}
+ functionExecutionStatus => #{status => <<"Executed-Success">>}
}}
]);
{cancelSessionResponseEsipa, {cancelSessionError, _CancelSessionError}} ->

To view, visit change 43818. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: onomondo-eim
Gerrit-Branch: master
Gerrit-Change-Id: I14edb8f60c755dfc8940015fe7c3436fa14e32b1
Gerrit-Change-Number: 43818
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>