Azure / Azure/azure-functions-host

JSON response being converted to camel casing in local environment

Open
#2,873 5 comments 5 reactions 1 assignee Claimed by @paulbatum View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

The Azure Function serialize the result in Camel Casing when running in the local development environment while the results are serialized in Pascal Casing while running on the cloud. The same code generates different JSON result while running on development machines and on cloud.

Runtimes:
-Functions Runtime Version - 2.0.11651.0
-Functions Core Tools Version - 220.0.0-beta.0

```csharp
public static async Task Run([HttpTrigger(AuthorizationLevel.Function, "get", Route = "TestCasing")]HttpRequest req, TraceWriter log)
{
var result = new {PropertyName1 = "Foo", PropertyName2 = "Bar" };
return new OkObjectResult(result);
}
```
When running on local development machines, it outputs the following json
`
{"propertyName1":"Foo","propertyName2":"Bar"}
`

When the same code is hosted on the cloud, the following json is produced
`
{"PropertyName1":"Foo","PropertyName2":"Bar"}
`

We expect the same casing in json result as defined in the response model.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.