title: Serialize enum as string in JSON returned from Azure Function
body: <p>Is there a way to configure how Azure Functions serializes an object into JSON for the return value? I would like to use strings rather than ints for enum values.</p>
  
  <p>For instance, given this code:-</p>
  
  <pre><code>public enum Sauce
  {
      None,
      Hot
  }
  
  public class Dish
  {
      [JsonConverter(typeof(StringEnumConverter))]
      public Sauce Sauce;
  }
  
  public static class MyFunction
  {
      [FunctionName("MakeDinner")]
      public static async Task&lt;HttpResponseMessage&gt; Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)]HttpRequestMessage req, TraceWriter log)
      {
          var dish = new Dish() { Sauce = Sauce.Hot };
          return req.CreateResponse(HttpStatusCode.OK, dish, "application/json");
      }
  }
  </code></pre>
  
  <p>The function returns:-</p>
  
  <pre><code>{
     "Sauce": 1
  }
  </code></pre>
  
  <p>How can I make it return the below?</p>
  
  <pre><code>{
     "Sauce": "Hot"
  }
  </code></pre>
  
  <p>I've tried returning a string instead of an object, but the result contains <code>\"</code> escapes; I want a JSON result, not an escaped string representation of a JSON object.</p>
  
  <p>I know that in standard <code>ASP.NET</code> I can use the config to set serialization options. Is this even possible in Functions, or should I convert all my Enums to string constants?</p>