Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
Fixed some minor formatting issues with the JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
ecyr20 committed Apr 9, 2024
1 parent 6f719af commit c59330c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Services/OpenAtmosService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ public async Task<string> Get(Guid tag_mechanism_uuid)
}
else if(property.string_value != null)
{
JSON += property.string_value;
JSON += "\"" + property.string_value + "\"";
}

JSON += " , \n";
JSON += ", \n";
}
JSON.Remove(JSON.LastIndexOf(','));
JSON = JSON.Remove(JSON.LastIndexOf(','));
JSON += "\n";
JSON += " }, \n";
}
JSON.Remove(JSON.LastIndexOf(','));
JSON = JSON.Remove(JSON.LastIndexOf(','));

JSON += " ],\n" +
" \"phases\": [ \n" +
Expand All @@ -72,7 +73,8 @@ public async Task<string> Get(Guid tag_mechanism_uuid)
{
JSON += " \"" + species.type + "\", \n";
}
JSON.Remove(JSON.LastIndexOf(','));
JSON = JSON.Remove(JSON.LastIndexOf(','));
JSON += "\n";
JSON += " ] \n" +
" } \n" +
" ],\n" +
Expand Down Expand Up @@ -111,7 +113,7 @@ public async Task<string> Get(Guid tag_mechanism_uuid)
JSON += "\"" + property.string_value + "\"";
}

JSON += " , \n";
JSON += ", \n";
}
var reactants = reactantProductListService.GetReactantsAsync(reaction.reactant_list_uuid).Result;
JSON += " \"reactants\": [ \n" +
Expand All @@ -133,10 +135,11 @@ public async Task<string> Get(Guid tag_mechanism_uuid)
JSON += " \"coefficient\": \"" + product.quantity + "\" \n";
}
JSON += " }\n" +
" ], \n";
JSON += " }\n";
" ]\n";
JSON += " },\n";
}

JSON = JSON.Remove(JSON.LastIndexOf(','));
JSON += "\n";
JSON += " ]\n}";
return JSON;
}
Expand Down

0 comments on commit c59330c

Please sign in to comment.