elsa-workflows / elsa-core

A .NET workflows library
https://v3.elsaworkflows.io/
MIT License
6.58k stars 1.21k forks source link

Elsa 3 no way to change response serialization case to match entities #4338

Open ricksearcy opened 1 year ago

ricksearcy commented 1 year ago

Currently there is no way to return activity data via and endpoint response that matches the internal pascal case of the entity classes. 

We have internal entities that we use in custom activities. Many of the activities return these entities to the client via endpoint responses.Right now the entities are always returned in camel case with no way to change the default behavior to pascal to match the entity case, which can then create issues when using property data for any further activities. 

sfmskywalker commented 1 year ago

Hello!

Thank you for bringing this up. While we could consider making this configurable, it might introduce inconsistencies in designer applications that rely on a specific response format.

If you're keen on using FastEndpoints for your API endpoints, you might want to manually serialize the response to a JSON string within your endpoint method. You can find an example of this approach here.

Alternatively, you can explore ASP.NET Core's API controllers or their minimal API feature. This would grant you full control over response serialization for all your endpoints.

Hope this helps!