< Summary

Information
Class: NexusLabs.Needlr.AgentFramework.Generators.ObjectPropertyInfo
Assembly: NexusLabs.Needlr.AgentFramework.Generators
File(s): /home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework.Generators/Models/ObjectPropertyInfo.cs
Line coverage
86%
Covered lines: 13
Uncovered lines: 2
Coverable lines: 15
Total lines: 59
Line coverage: 86.6%
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
.ctor(...)100%11100%
get_CSharpName()100%11100%
get_JsonName()100%11100%
get_CSharpTypeFullName()100%11100%
get_SchemaType()100%11100%
get_SchemaFormat()100%11100%
get_IsNullable()100%210%
get_InitDefaultLiteral()100%210%

File(s)

/home/runner/work/needlr/needlr/src/NexusLabs.Needlr.AgentFramework.Generators/Models/ObjectPropertyInfo.cs

#LineLine coverage
 1namespace NexusLabs.Needlr.AgentFramework.Generators;
 2
 3/// <summary>
 4/// Describes a single property of a complex object type used as an array element
 5/// in an agent function parameter. Used for AOT-safe manual deserialization from
 6/// JsonElement.
 7/// </summary>
 8internal readonly struct ObjectPropertyInfo
 9{
 10    public ObjectPropertyInfo(
 11        string csharpName,
 12        string jsonName,
 13        string csharpTypeFullName,
 14        string schemaType,
 15        string? schemaFormat,
 16        bool isNullable,
 17        string? initDefaultLiteral)
 18    {
 2219        CSharpName = csharpName;
 2220        JsonName = jsonName;
 2221        CSharpTypeFullName = csharpTypeFullName;
 2222        SchemaType = schemaType;
 2223        SchemaFormat = schemaFormat;
 2224        IsNullable = isNullable;
 2225        InitDefaultLiteral = initDefaultLiteral;
 2226    }
 27
 28    /// <summary>The C# property name (PascalCase, e.g., "Topic").</summary>
 2229    public string CSharpName { get; }
 30
 31    /// <summary>The JSON property name (camelCase, e.g., "topic").</summary>
 11032    public string JsonName { get; }
 33
 34    /// <summary>The fully-qualified C# type name (e.g., <c>"global::System.DateTimeOffset"</c>).</summary>
 735    public string CSharpTypeFullName { get; }
 36
 37    /// <summary>The JSON schema type (e.g., "string", "integer", "boolean").</summary>
 2238    public string SchemaType { get; }
 39
 40    /// <summary>
 41    /// JSON Schema <c>format</c> hint for stringified value types (e.g., <c>"uuid"</c>,
 42    /// <c>"date-time"</c>, <c>"duration"</c>). <see langword="null"/> when no format applies.
 43    /// </summary>
 1644    public string? SchemaFormat { get; }
 45
 46    /// <summary>Whether the property is nullable.</summary>
 047    public bool IsNullable { get; }
 48
 49    /// <summary>
 50    /// The C# literal expression for the property's initializer default, when present and
 51    /// expressible as a simple literal. For example, <c>"\"default\""</c> for
 52    /// <c>public string Foo { get; init; } = "default";</c> or <c>"5"</c> for
 53    /// <c>public int Count { get; init; } = 5;</c>. <see langword="null"/> when the
 54    /// property has no initializer (or the initializer is not a simple literal expression).
 55    /// Emitted as the fallback when a DTO payload supplies the property as
 56    /// <c>JsonValueKind.Null</c> / <c>JsonValueKind.Undefined</c>.
 57    /// </summary>
 058    public string? InitDefaultLiteral { get; }
 59}