Skip to content

Codex/experimental stage detection#158

Merged
HavenDV merged 4 commits intomainfrom
codex/experimental-stage-detection
Mar 13, 2026
Merged

Codex/experimental stage detection#158
HavenDV merged 4 commits intomainfrom
codex/experimental-stage-detection

Conversation

@HavenDV
Copy link
Collaborator

@HavenDV HavenDV commented Mar 13, 2026

Summary by CodeRabbit

  • New Features

    • Added support for marking APIs as experimental with conditional attributes for .NET 8 and greater.
    • Implemented deprecation detection using method-based evaluation instead of direct property access.
    • Added support for Fern's x-fern-availability extension to properly identify deprecated and beta APIs.
    • Enhanced handling of streaming operations in code generation.
  • Tests

    • Added unit tests for deprecation exclusion, experimental stage mapping, and Fern availability support.
    • Added integration test for streaming SDK generation.

@HavenDV HavenDV merged commit 44e4423 into main Mar 13, 2026
3 of 4 checks passed
@HavenDV HavenDV deleted the codex/experimental-stage-detection branch March 13, 2026 20:53
@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 2026

Walkthrough

This pull request introduces enhanced deprecation and experimental stage detection for OpenAPI operations and schemas through new extension methods, updates the deprecation evaluation across multiple models to use these methods, refactors test structure to validate ResponseStream generation, and applies conditional Experimental attributes to generated Twitch API client methods for .NET 8+.

Changes

Cohort / File(s) Summary
Deprecation & Experimental Stage Extensions
src/libs/AutoSDK/Extensions/OpenApiExtensions.cs
Added public methods IsDeprecated() for operations and schemas, plus GetExperimentalStageFromSummary() and StripExperimentalStagePrefix(). Introduced internal helpers for robust parsing of experimental/deprecation metadata from OpenAPI extensions with fallback logic and normalization utilities.
Model Deprecation Method Updates
src/libs/AutoSDK/Models/{EndPoint,MethodParameter,ModelData,PropertyData,TypeData}.cs
Systematically replaced property-based deprecation checks (context.Deprecated or schema.Deprecated) with calls to the new IsDeprecated() method across five model factories.
Generation Pipeline & Naming
src/libs/AutoSDK/Commands/GenerateCommand.cs, src/libs/AutoSDK/Naming/Methods/SummaryGenerator.cs, src/libs/AutoSDK/Sources/{Data,Sources.Http}.cs
Added conditional ResponseStream source inclusion in GenerateCommand; integrated experimental prefix stripping in SummaryGenerator; replaced property checks with IsDeprecated() method calls in Data and Sources.Http for deprecation filtering and labeling.
CLI Integration Test
src/tests/AutoSDK.IntegrationTests.Cli/CliTests.cs
Refactored test from parameterized data-driven approach to dedicated Generate_ElevenLabsStreamingSdk() method with private GenerateAsync() helper, adding runtime assertion for ResponseStream.g.cs file generation.
Experimental Attribute Snapshot Tests
src/tests/AutoSDK.SnapshotTests/Snapshots/{CLI,twitch}/...
Added conditional [Experimental(diagnosticId: "G_BETA_001")] attributes guarded by #if NET8_0_OR_GREATER to 24 generated Twitch GuestStarClient methods across both client implementation and interface definitions.
Unit Test Coverage
src/tests/AutoSDK.UnitTests/{DataTests,HttpTests,NamingTests.Methods}.cs
Added 6 new test methods validating deprecation exclusion, Fern availability mapping to experimental stages, experimental prefix stripping behavior, and x-fern-availability schema deprecation propagation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 With methods new to mark what's worn and old,
And stages bright in summaries retold,
We strip the prefixes, the marks away,
And let deprecated paths have their day.
For streams and beta features, crisp and clear—
The SDK hops forward, year by year! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 1.41% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding experimental stage detection functionality based on summary parsing and fern-availability metadata, which is the primary focus across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/experimental-stage-detection
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
src/tests/AutoSDK.UnitTests/NamingTests.Methods.cs (1)

46-52: Consider extracting repeated Settings initialization into a shared helper.

This same setup appears in multiple tests and can be centralized to reduce noise and maintenance cost.

♻️ Suggested refactor
 public partial class NamingTests
 {
+    private static Settings CreateSummaryNamingSettings() => Settings.Default with
+    {
+        Namespace = "LangSmith",
+        ClassName = "LangSmithClient",
+        ClsCompliantEnumPrefix = "x",
+        MethodNamingConvention = MethodNamingConvention.Summary,
+    };
+
     [TestMethod]
     public void SummaryMethodNames_StripExperimentalPrefixesFromIdentifiers()
     {
-        var settings = Settings.Default with
-        {
-            Namespace = "LangSmith",
-            ClassName = "LangSmithClient",
-            ClsCompliantEnumPrefix = "x",
-            MethodNamingConvention = MethodNamingConvention.Summary,
-        };
+        var settings = CreateSummaryNamingSettings();
         ...
     }

     [TestMethod]
     public void FernAvailabilityBeta_MapsToExperimentalStage()
     {
-        var settings = Settings.Default with
-        {
-            Namespace = "LangSmith",
-            ClassName = "LangSmithClient",
-            ClsCompliantEnumPrefix = "x",
-            MethodNamingConvention = MethodNamingConvention.Summary,
-        };
+        var settings = CreateSummaryNamingSettings();
         ...
     }
 }

Also applies to: 77-83, 112-118

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/tests/AutoSDK.UnitTests/NamingTests.Methods.cs` around lines 46 - 52,
Several tests repeatedly construct the same Settings instance (Settings.Default
with Namespace="LangSmith", ClassName="LangSmithClient",
ClsCompliantEnumPrefix="x",
MethodNamingConvention=MethodNamingConvention.Summary); extract this into a
shared helper or factory (e.g., CreateDefaultTestSettings or
GetBaselineSettings) and have the tests call that helper and modify only fields
they need, then replace the duplicate initializations in NamingTests.Methods
(and the other occurrences mentioned) with calls to the helper to centralize and
reduce duplication.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/libs/AutoSDK/Extensions/OpenApiExtensions.cs`:
- Around line 822-827: The current detection using trimmed.StartsWith(prefix,
...) on ExperimentalStagePrefixes can match inside words (e.g., "Alphabet"), so
update the check in OpenApiExtensions.cs where you iterate
ExperimentalStagePrefixes to ensure the prefix is a standalone token: after
matching the prefix, verify either the prefix reaches the end of the string or
the next character is a non-letter/non-digit (or use a word-boundary regex)
before returning stage; apply the same token-boundary logic to the other similar
checks (the other loops using ExperimentalStagePrefixes and StartsWith at the
other occurrences) to avoid false positives.
- Around line 787-790: TryGetAvailability returns a normalized availability
value (e.g., GenerallyAvailable) but NormalizeExperimentalStage only checks for
the hyphenated string "GENERALLY-AVAILABLE", causing GA items to be treated as
experimental; update NormalizeExperimentalStage (and its callers) to do a
case-insensitive, punctuation-insensitive comparison (e.g., remove
hyphens/underscores and compare to "GENERALLYAVAILABLE") or accept the
normalized enum/value from TryGetAvailability directly and treat that as GA,
ensuring both "GenerallyAvailable" and "GENERALLY-AVAILABLE" map to
non-experimental; adjust the checks used in NormalizeExperimentalStage (and
similar logic at the other occurrences referenced) to use this normalized
comparison.

In `@src/libs/AutoSDK/Models/MethodParameter.cs`:
- Line 97: The current MethodParameter construction only uses
context.Schema.IsDeprecated() and therefore misses parameter-level deprecation
flags; update the IsDeprecated assignment in the MethodParameter builder to
consider both the OpenApiParameter.Deprecated flag and the schema deprecation
(e.g., check context.Parameter?.Deprecated or equivalent and OR it with
context.Schema.IsDeprecated()), so MethodParameter.IsDeprecated reflects either
source of deprecation.

---

Nitpick comments:
In `@src/tests/AutoSDK.UnitTests/NamingTests.Methods.cs`:
- Around line 46-52: Several tests repeatedly construct the same Settings
instance (Settings.Default with Namespace="LangSmith",
ClassName="LangSmithClient", ClsCompliantEnumPrefix="x",
MethodNamingConvention=MethodNamingConvention.Summary); extract this into a
shared helper or factory (e.g., CreateDefaultTestSettings or
GetBaselineSettings) and have the tests call that helper and modify only fields
they need, then replace the duplicate initializations in NamingTests.Methods
(and the other occurrences mentioned) with calls to the helper to centralize and
reduce duplication.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 76c3d040-0f9e-4fe7-baf6-ddf03a23b8c1

📥 Commits

Reviewing files that changed from the base of the PR and between c6f3079 and b39cb58.

📒 Files selected for processing (62)
  • src/libs/AutoSDK.CLI/Commands/GenerateCommand.cs
  • src/libs/AutoSDK/Extensions/OpenApiExtensions.cs
  • src/libs/AutoSDK/Models/EndPoint.cs
  • src/libs/AutoSDK/Models/MethodParameter.cs
  • src/libs/AutoSDK/Models/ModelData.cs
  • src/libs/AutoSDK/Models/PropertyData.cs
  • src/libs/AutoSDK/Models/TypeData.cs
  • src/libs/AutoSDK/Naming/Methods/SummaryGenerator.cs
  • src/libs/AutoSDK/Sources/Data.cs
  • src/libs/AutoSDK/Sources/Sources.Http.cs
  • src/tests/AutoSDK.IntegrationTests.Cli/CliTests.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.GuestStarClient.AssignGuestStarSlot.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.GuestStarClient.CreateGuestStarSession.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.GuestStarClient.DeleteGuestStarInvite.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.GuestStarClient.DeleteGuestStarSlot.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.GuestStarClient.EndGuestStarSession.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.GuestStarClient.GetChannelGuestStarSettings.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.GuestStarClient.GetGuestStarInvites.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.GuestStarClient.GetGuestStarSession.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.GuestStarClient.SendGuestStarInvite.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.GuestStarClient.UpdateChannelGuestStarSettings.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.GuestStarClient.UpdateGuestStarSlot.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.GuestStarClient.UpdateGuestStarSlotSettings.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.IGuestStarClient.AssignGuestStarSlot.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.IGuestStarClient.CreateGuestStarSession.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.IGuestStarClient.DeleteGuestStarInvite.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.IGuestStarClient.DeleteGuestStarSlot.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.IGuestStarClient.EndGuestStarSession.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.IGuestStarClient.GetChannelGuestStarSettings.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.IGuestStarClient.GetGuestStarInvites.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.IGuestStarClient.GetGuestStarSession.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.IGuestStarClient.SendGuestStarInvite.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.IGuestStarClient.UpdateChannelGuestStarSettings.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.IGuestStarClient.UpdateGuestStarSlot.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/CLI/twitch/_#G.IGuestStarClient.UpdateGuestStarSlotSettings.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.GuestStarClient.AssignGuestStarSlot.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.GuestStarClient.CreateGuestStarSession.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.GuestStarClient.DeleteGuestStarInvite.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.GuestStarClient.DeleteGuestStarSlot.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.GuestStarClient.EndGuestStarSession.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.GuestStarClient.GetChannelGuestStarSettings.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.GuestStarClient.GetGuestStarInvites.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.GuestStarClient.GetGuestStarSession.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.GuestStarClient.SendGuestStarInvite.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.GuestStarClient.UpdateChannelGuestStarSettings.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.GuestStarClient.UpdateGuestStarSlot.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.GuestStarClient.UpdateGuestStarSlotSettings.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.IGuestStarClient.AssignGuestStarSlot.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.IGuestStarClient.CreateGuestStarSession.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.IGuestStarClient.DeleteGuestStarInvite.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.IGuestStarClient.DeleteGuestStarSlot.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.IGuestStarClient.EndGuestStarSession.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.IGuestStarClient.GetChannelGuestStarSettings.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.IGuestStarClient.GetGuestStarInvites.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.IGuestStarClient.GetGuestStarSession.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.IGuestStarClient.SendGuestStarInvite.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.IGuestStarClient.UpdateChannelGuestStarSettings.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.IGuestStarClient.UpdateGuestStarSlot.g.verified.cs
  • src/tests/AutoSDK.SnapshotTests/Snapshots/twitch/SystemTextJson/_#G.IGuestStarClient.UpdateGuestStarSlotSettings.g.verified.cs
  • src/tests/AutoSDK.UnitTests/DataTests.cs
  • src/tests/AutoSDK.UnitTests/HttpTests.cs
  • src/tests/AutoSDK.UnitTests/NamingTests.Methods.cs

Comment on lines +787 to +790
if (TryGetAvailability(operation.Extensions, out var availability))
{
return NormalizeExperimentalStage(availability);
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix generally-available normalization mismatch (currently treated as experimental).

TryGetAvailability normalizes to GenerallyAvailable, but NormalizeExperimentalStage only suppresses GENERALLY-AVAILABLE (hyphenated). That returns a non-empty stage and can incorrectly mark GA operations as experimental.

💡 Proposed fix
 private static string NormalizeExperimentalStage(string? stage)
 {
     var normalized = stage?.Trim() ?? string.Empty;
     if (normalized.Length == 0)
     {
         return string.Empty;
     }

     return normalized.ToUpperInvariant() switch
     {
         "ALPHA" => "Alpha",
         "BETA" => "Beta",
         "EXPERIMENTAL" => "Experimental",
-        "GENERALLY-AVAILABLE" => string.Empty,
+        "GENERALLY-AVAILABLE" or "GENERALLYAVAILABLE" => string.Empty,
         "DEPRECATED" => string.Empty,
         _ => normalized,
     };
 }

Also applies to: 971-979, 990-996

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/libs/AutoSDK/Extensions/OpenApiExtensions.cs` around lines 787 - 790,
TryGetAvailability returns a normalized availability value (e.g.,
GenerallyAvailable) but NormalizeExperimentalStage only checks for the
hyphenated string "GENERALLY-AVAILABLE", causing GA items to be treated as
experimental; update NormalizeExperimentalStage (and its callers) to do a
case-insensitive, punctuation-insensitive comparison (e.g., remove
hyphens/underscores and compare to "GENERALLYAVAILABLE") or accept the
normalized enum/value from TryGetAvailability directly and treat that as GA,
ensuring both "GenerallyAvailable" and "GENERALLY-AVAILABLE" map to
non-experimental; adjust the checks used in NormalizeExperimentalStage (and
similar logic at the other occurrences referenced) to use this normalized
comparison.

Comment on lines +822 to +827
foreach (var (prefix, stage) in ExperimentalStagePrefixes)
{
if (trimmed.StartsWith(prefix, StringComparison.OrdinalIgnoreCase))
{
return stage;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use token-boundary checks for stage prefixes to avoid false positives.

Current StartsWith on plain prefixes (Alpha, Beta, Experimental) will match unrelated words (e.g., Alphabet), causing wrong stage detection/summary stripping.

💡 Proposed fix
 foreach (var (prefix, stage) in ExperimentalStagePrefixes)
 {
-    if (trimmed.StartsWith(prefix, StringComparison.OrdinalIgnoreCase))
+    if (trimmed.StartsWith(prefix, StringComparison.OrdinalIgnoreCase) &&
+        (prefix.StartsWith("[", StringComparison.Ordinal) ||
+         trimmed.Length == prefix.Length ||
+         " \t:-_".Contains(trimmed[prefix.Length])))
     {
         return stage;
     }
 }
 foreach (var (prefix, _) in ExperimentalStagePrefixes)
 {
-    if (!trimmed.StartsWith(prefix, StringComparison.OrdinalIgnoreCase))
+    if (!trimmed.StartsWith(prefix, StringComparison.OrdinalIgnoreCase) ||
+        (!prefix.StartsWith("[", StringComparison.Ordinal) &&
+         trimmed.Length > prefix.Length &&
+         !" \t:-_".Contains(trimmed[prefix.Length])))
     {
         continue;
     }

     var remainder = trimmed.Substring(prefix.Length).TrimStart(' ', '\t', ':', '-', '_');
     return string.IsNullOrWhiteSpace(remainder) ? trimmed : remainder;
 }

Also applies to: 842-850, 953-961

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/libs/AutoSDK/Extensions/OpenApiExtensions.cs` around lines 822 - 827, The
current detection using trimmed.StartsWith(prefix, ...) on
ExperimentalStagePrefixes can match inside words (e.g., "Alphabet"), so update
the check in OpenApiExtensions.cs where you iterate ExperimentalStagePrefixes to
ensure the prefix is a standalone token: after matching the prefix, verify
either the prefix reaches the end of the string or the next character is a
non-letter/non-digit (or use a word-boundary regex) before returning stage;
apply the same token-boundary logic to the other similar checks (the other loops
using ExperimentalStagePrefixes and StartsWith at the other occurrences) to
avoid false positives.

Explode: parameter.Explode,
Settings: context.Settings,
IsDeprecated: context.Schema.Deprecated,
IsDeprecated: context.Schema.IsDeprecated(),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Preserve parameter-level deprecation when building MethodParameter.

This currently reads only schema deprecation and can miss OpenApiParameter.Deprecated.

💡 Proposed fix
-            IsDeprecated: context.Schema.IsDeprecated(),
+            IsDeprecated: parameter.Deprecated || context.Schema.IsDeprecated(),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
IsDeprecated: context.Schema.IsDeprecated(),
IsDeprecated: parameter.Deprecated || context.Schema.IsDeprecated(),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/libs/AutoSDK/Models/MethodParameter.cs` at line 97, The current
MethodParameter construction only uses context.Schema.IsDeprecated() and
therefore misses parameter-level deprecation flags; update the IsDeprecated
assignment in the MethodParameter builder to consider both the
OpenApiParameter.Deprecated flag and the schema deprecation (e.g., check
context.Parameter?.Deprecated or equivalent and OR it with
context.Schema.IsDeprecated()), so MethodParameter.IsDeprecated reflects either
source of deprecation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant