-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat:Add JSON converters for MissingMissing1 type and enhance chart API methods #32
Conversation
WalkthroughThe changes introduce new JSON converters for the Changes
Sequence Diagram(s)sequenceDiagram
participant API as API
participant ChartService as Chart Service
participant ChartCreate as Create Chart
participant ChartUpdate as Update Chart
API->>ChartCreate: Create Chart with commonFilters
ChartCreate->>ChartService: Process chart creation with filters
ChartService-->>ChartCreate: Return chart response
ChartCreate-->>API: Return response
API->>ChartUpdate: Update Chart with commonFilters
ChartUpdate->>ChartService: Process chart update with filters
ChartService-->>ChartUpdate: Return update response
ChartUpdate-->>API: Return response
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (17)
- src/libs/LangSmith/Generated/JsonConverters.MissingMissing1.g.cs (1 hunks)
- src/libs/LangSmith/Generated/JsonConverters.MissingMissing1Nullable.g.cs (1 hunks)
- src/libs/LangSmith/Generated/JsonSerializerContext.g.cs (1 hunks)
- src/libs/LangSmith/Generated/LangSmith.ChartsClient.CreateChartApiV1ChartsCreatePost.g.cs (3 hunks)
- src/libs/LangSmith/Generated/LangSmith.ChartsClient.UpdateChartApiV1ChartsChartIdPatch.g.cs (3 hunks)
- src/libs/LangSmith/Generated/LangSmith.Models.CustomChartCreate.g.cs (1 hunks)
- src/libs/LangSmith/Generated/LangSmith.Models.CustomChartCreatePreview.g.cs (2 hunks)
- src/libs/LangSmith/Generated/LangSmith.Models.CustomChartSeries.g.cs (1 hunks)
- src/libs/LangSmith/Generated/LangSmith.Models.CustomChartSeriesCreate.g.cs (1 hunks)
- src/libs/LangSmith/Generated/LangSmith.Models.CustomChartSeriesFilters.g.cs (1 hunks)
- src/libs/LangSmith/Generated/LangSmith.Models.CustomChartSeriesUpdate.g.cs (1 hunks)
- src/libs/LangSmith/Generated/LangSmith.Models.CustomChartUpdate.g.cs (2 hunks)
- src/libs/LangSmith/Generated/LangSmith.Models.CustomChartsSectionResponse.g.cs (1 hunks)
- src/libs/LangSmith/Generated/LangSmith.Models.Missing.g.cs (1 hunks)
- src/libs/LangSmith/Generated/LangSmith.Models.MissingMissing1.g.cs (1 hunks)
- src/libs/LangSmith/Generated/LangSmith.Models.SingleCustomChartResponse.g.cs (1 hunks)
- src/libs/LangSmith/openapi.yaml (13 hunks)
Additional context used
GitHub Check: Test / Build, test and publish
src/libs/LangSmith/Generated/LangSmith.Models.CustomChartUpdate.g.cs
[failure] 39-39:
Identifier expected
[failure] 39-39:
Identifier expected
[failure] 39-39:
Identifier expected
[failure] 39-39:
Identifier expected
[failure] 39-39:
Identifier expected
[failure] 39-39:
Identifier expected
[failure] 39-39:
Identifier expected
[failure] 39-39:
Identifier expected
Additional comments not posted (31)
src/libs/LangSmith/Generated/LangSmith.Models.Missing.g.cs (1)
11-16
: LGTM!The addition of the
Missing1
property with appropriate JSON serialization attributes is well-implemented.src/libs/LangSmith/Generated/LangSmith.Models.MissingMissing1.g.cs (1)
1-44
: LGTM!The definition of the
MissingMissing1
enum and its extension methods for conversion are well-structured and efficient.src/libs/LangSmith/Generated/LangSmith.Models.CustomChartCreatePreview.g.cs (1)
20-25
: LGTM!The addition of the
CommonFilters
property with appropriate JSON serialization attributes and the use of theAnyOf
construct enhance the class's flexibility. The pragma directive is appropriately used to suppress warnings about obsolete types or members.src/libs/LangSmith/Generated/JsonConverters.MissingMissing1.g.cs (1)
39-46
: LGTM! TheWrite
method is implemented correctly.The method handles serialization appropriately with a null check for the writer.
src/libs/LangSmith/Generated/LangSmith.Models.CustomChartSeriesCreate.g.cs (1)
24-25
: Consider the impact of theFilters
property type change.The change to a nullable
AnyOf
type with a custom JSON converter adds flexibility but may affect existing code that assumesFilters
is always present and of a specific type. Ensure that dependent code is updated accordingly.src/libs/LangSmith/Generated/LangSmith.Models.CustomChartSeriesFilters.g.cs (1)
38-39
: Consider the impact of theSession
property type change.The change to a nullable
AnyOf
type with a custom JSON converter adds flexibility but may affect existing code that assumesSession
is always present and of a specific type. Ensure that dependent code is updated accordingly.src/libs/LangSmith/Generated/LangSmith.Models.CustomChartsSectionResponse.g.cs (1)
41-46
: LGTM! Addition ofIsAtCapacity
property.The new property
IsAtCapacity
is well-integrated with JSON serialization attributes, allowing for flexible data representation.src/libs/LangSmith/Generated/JsonConverters.MissingMissing1Nullable.g.cs (1)
1-56
: LGTM! Implementation ofMissingMissing1NullableJsonConverter
.The converter correctly handles string and number token types and throws an exception for unsupported types. The implementation is robust and follows best practices for JSON converters.
src/libs/LangSmith/Generated/LangSmith.Models.CustomChartSeries.g.cs (1)
24-25
: Consider the implications of changingFilters
type.The change to
System.AnyOf<LangSmith.CustomChartSeriesFilters, object>?
allows for more flexibility but removes the non-null requirement. Ensure that this change aligns with the intended data handling and validation logic.src/libs/LangSmith/Generated/LangSmith.Models.CustomChartSeriesUpdate.g.cs (1)
24-25
: Verify handling of potential null values forFilters
.The
Filters
property is now nullable, which may require additional null checks in the codebase to prevent potential null reference exceptions.Run the following script to verify the handling of potential null values:
src/libs/LangSmith/Generated/LangSmith.Models.CustomChartCreate.g.cs (1)
66-68
: Verify handling of potential null values forCommonFilters
.The
CommonFilters
property is nullable, which may require additional null checks in the codebase to prevent potential null reference exceptions.Run the following script to verify the handling of potential null values:
src/libs/LangSmith/Generated/LangSmith.Models.SingleCustomChartResponse.g.cs (1)
73-75
: Verify handling of potential null values forCommonFilters
.The
CommonFilters
property is nullable, which may require additional null checks in the codebase to prevent potential null reference exceptions.Run the following script to verify the handling of potential null values:
src/libs/LangSmith/Generated/LangSmith.Models.CustomChartUpdate.g.cs (1)
62-67
: Addition ofCommonFilters
property looks good.The
CommonFilters
property is correctly added with JSON serialization attributes, enhancing the class's functionality.src/libs/LangSmith/Generated/LangSmith.ChartsClient.CreateChartApiV1ChartsCreatePost.g.cs (2)
111-111
: Addition ofcommonFilters
parameter is well-documented.The
commonFilters
parameter is correctly added and documented, enhancing the method's flexibility.
Line range hint
122-134
: Integration ofcommonFilters
parameter is correct.The
commonFilters
parameter is correctly integrated into the method signature and request object, enhancing filtering capabilities.src/libs/LangSmith/Generated/LangSmith.ChartsClient.UpdateChartApiV1ChartsChartIdPatch.g.cs (2)
116-116
: Addition ofcommonFilters
parameter is well-documented.The
commonFilters
parameter is correctly added and documented, enhancing the method's flexibility.
Line range hint
128-140
: Integration ofcommonFilters
parameter is correct.The
commonFilters
parameter is correctly integrated into the method signature and request object, enhancing filtering capabilities.src/libs/LangSmith/Generated/JsonSerializerContext.g.cs (1)
40-41
: Ensure the new converters are implemented and tested.The converters
MissingMissing1JsonConverter
andMissingMissing1NullableJsonConverter
have been added. Verify that these converters are correctly implemented and covered by tests.Run the following script to verify the implementation of these converters:
src/libs/LangSmith/openapi.yaml (13)
10283-10286
: LGTM! Addition ofcommon_filters
property.The addition of the
common_filters
property with ananyOf
structure enhances flexibility by allowing optional filters.
10298-10301
: LGTM! Addition ofcommon_filters
property.The addition of the
common_filters
property with ananyOf
structure inCustomChartMetric
enhances flexibility by allowing optional filters.
Line range hint
10303-10308
: No changes to review.This hunk provides context but does not contain any changes.
10391-10393
: LGTM! Modification offilters
property.The modification of the
filters
property to use ananyOf
structure allows for more flexible filter definitions.
10416-10418
: LGTM! Modification offilters
property.The modification of the
filters
property to use ananyOf
structure inCustomChartSeriesCreate
enhances flexibility.
Line range hint
10419-10424
: No changes to review.This hunk provides context but does not contain any changes.
10447-10453
: LGTM! Modification ofsession
property.The modification of the
session
property to use ananyOf
structure allows for more flexible session definitions.
10497-10553
: LGTM! Enhancements to property definitions.The modifications to include default values and use an
anyOf
structure improve handling of optional data.
10733-10737
: LGTM! Modification ofis_at_capacity
property.The modification of the
is_at_capacity
property to use ananyOf
structure allows for more flexible capacity definitions.
10747-10763
: LGTM! Enhancements to property definitions.The modifications to include default values and use an
anyOf
structure improve handling of optional data.
11096-11121
: LGTM! Enhancements to property definitions.The modifications to include default values and use an
anyOf
structure improve handling of optional data.
12807-12815
: LGTM! Definition ofMissing
component.The definition of the
Missing
component with a required__missing__
property aids in handling cases where data might be absent.
16369-16372
: LGTM! Addition ofcommon_filters
property.The addition of the
common_filters
property with ananyOf
structure inSingleCustomChartResponseBase
enhances flexibility by allowing optional filters.
default: | ||
throw new global::System.ArgumentOutOfRangeException(nameof(reader)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enhance the exception message for unsupported JSON token types.
The current exception message in ArgumentOutOfRangeException
could be more informative. Consider including the unsupported token type in the message for better debugging.
Apply this diff to improve the exception message:
- throw new global::System.ArgumentOutOfRangeException(nameof(reader));
+ throw new global::System.ArgumentOutOfRangeException(nameof(reader), $"Unsupported JSON token type: {reader.TokenType}");
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.
default: | |
throw new global::System.ArgumentOutOfRangeException(nameof(reader)); | |
default: | |
throw new global::System.ArgumentOutOfRangeException(nameof(reader), $"Unsupported JSON token type: {reader.TokenType}"); |
@@ -36,7 +36,7 @@ | |||
/// </summary> | |||
[global::System.Text.Json.Serialization.JsonPropertyName("chart_type")] | |||
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::OpenApiGenerator.JsonConverters.AnyOfJsonConverterFactory2))] | |||
public global::System.AnyOf<global::LangSmith.CustomChartType?, global::LangSmith.Missing>? ChartType { get; set; } | |||
public global::System.AnyOf<global::LangSmith.CustomChartType?, global::LangSmith.Missing>? ChartType { get; set; } = global::LangSmith.CustomChartType.; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the incomplete initialization of ChartType
.
The ChartType
property is initialized with global::LangSmith.CustomChartType.
which seems incomplete and is causing a syntax error.
Ensure that ChartType
is initialized with a valid enum value. For example:
- public global::System.AnyOf<global::LangSmith.CustomChartType?, global::LangSmith.Missing>? ChartType { get; set; } = global::LangSmith.CustomChartType.;
+ public global::System.AnyOf<global::LangSmith.CustomChartType?, global::LangSmith.Missing>? ChartType { get; set; } = global::LangSmith.CustomChartType.SomeValue;
Replace SomeValue
with the appropriate default value.
Committable suggestion was skipped due to low confidence.
Tools
GitHub Check: Test / Build, test and publish
[failure] 39-39:
Identifier expected
[failure] 39-39:
Identifier expected
[failure] 39-39:
Identifier expected
[failure] 39-39:
Identifier expected
[failure] 39-39:
Identifier expected
[failure] 39-39:
Identifier expected
[failure] 39-39:
Identifier expected
[failure] 39-39:
Identifier expected
Summary by CodeRabbit
New Features
MissingMissing1
andMissingMissing1?
, enhancing JSON serialization and deserialization.commonFilters
property for improved filtering capabilities in various chart-related API methods and models.IsAtCapacity
property added to represent the capacity status in chart section responses.CustomChartUpdate
with a default value forChartType
.Bug Fixes
Documentation