< Summary

Information
Class: Elsa.Bpmn.Interchange.Endpoints.Bpmn.BpmnDocumentJsonOptions
Assembly: Elsa.Bpmn.Interchange
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Bpmn.Interchange/Endpoints/Bpmn/BpmnDocumentJsonOptions.cs
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 25
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.cctor()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Bpmn.Interchange/Endpoints/Bpmn/BpmnDocumentJsonOptions.cs

#LineLine coverage
 1using System.Text.Json;
 2using Bpmn.Model;
 3
 4namespace Elsa.Bpmn.Interchange.Endpoints.Bpmn;
 5
 6/// <summary>
 7/// The <see cref="JsonSerializerOptions"/> the <c>bpmn/definitions/{definitionId}/document</c> endpoints read and
 8/// write a <see cref="BpmnDefinitions"/> document with.
 9/// </summary>
 10/// <remarks>
 11/// <c>Bpmn.Model</c> declares every serialized property name explicitly through <c>[JsonPropertyName]</c> — see
 12/// <see cref="BpmnPayloadFormat"/> — and carries no <c>[JsonConverter]</c> of its own, so its wire shape is
 13/// plain <see cref="System.Text.Json.JsonSerializer"/> defaults: camelCase names exactly as declared, and any enum
 14/// as its underlying integer. Elsa's own API-wide serializer (<c>Elsa.Workflows.Serialization.Serializers.ApiSerializer
 15/// reached through FastEndpoints' configured <c>IApiSerializer</c>) adds a <c>JsonStringEnumConverter</c> and several
 16/// other converters of its own, none of which this library's schema expects. Letting the document body go through
 17/// that serializer, the way an ordinary FastEndpoints request or response DTO does, would silently write a shape
 18/// <c>Bpmn.Model</c>'s own reader does not agree is the payload format it published — hence the document endpoints
 19/// binding and writing the body explicitly with this instance instead of a request/response DTO.
 20/// </remarks>
 21internal static class BpmnDocumentJsonOptions
 22{
 23    /// <summary>Plain <see cref="System.Text.Json"/> defaults, scoped to the document endpoints only.</summary>
 124    public static readonly JsonSerializerOptions Value = new();
 25}

Methods/Properties

.cctor()