Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,8 @@ public sealed record class AIJsonSchemaCreateOptions
/// </summary>
public AIJsonSchemaTransformOptions? TransformOptions { get; init; }

/// <summary>
/// Gets a value indicating whether to include the type keyword in created schemas for .NET enums.
/// </summary>
[Obsolete("This property has been deprecated.")]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool IncludeTypeInEnumSchemas { get; init; } = true;

/// <summary>
/// Gets a value indicating whether to generate schemas with the additionalProperties set to false for .NET objects.
/// </summary>
[Obsolete("This property has been deprecated. Use the equivalent property in TransformOptions instead.")]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool DisallowAdditionalProperties { get; init; }

/// <summary>
/// Gets a value indicating whether to include the $schema keyword in created schemas.
/// </summary>
public bool IncludeSchemaKeyword { get; init; }

/// <summary>
/// Gets a value indicating whether to mark all properties as required in the schema.
/// </summary>
[Obsolete("This property has been deprecated. Use the equivalent property in TransformOptions instead.")]
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public bool RequireAllProperties { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
using Microsoft.Extensions.AI.JsonSchemaExporter;
using Xunit;

#pragma warning disable 0618 // Suppress obsolete warnings

namespace Microsoft.Extensions.AI;

public static partial class AIJsonUtilitiesTests
Expand Down Expand Up @@ -73,10 +71,7 @@ public static void DefaultOptions_UsesReflectionWhenDefault()
public static void AIJsonSchemaCreateOptions_DefaultInstance_ReturnsExpectedValues(bool useSingleton)
{
AIJsonSchemaCreateOptions options = useSingleton ? AIJsonSchemaCreateOptions.Default : new AIJsonSchemaCreateOptions();
Assert.True(options.IncludeTypeInEnumSchemas);
Assert.False(options.DisallowAdditionalProperties);
Assert.False(options.IncludeSchemaKeyword);
Assert.False(options.RequireAllProperties);
Assert.Null(options.TransformSchemaNode);
Assert.Null(options.TransformOptions);
}
Expand Down
Loading