Update API Clients#18
Conversation
📝 WalkthroughWalkthroughThis PR removes the entire C# SDK codebase except for documentation and a few model classes. The OpenAPI specification version is bumped to 1.0.3, with corresponding schema updates to models like ChangesOpenAPI 1.0.3 Model and Schema Updates
API Surface and Client Infrastructure Removal
Test Suite and Build Infrastructure Removal
🎯 4 (Complex) | ⏱️ ~60 minutes
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
C#/docs/Issue.md (1)
11-12: ⚖️ Poor tradeoffType safety degraded: strongly-typed models replaced with Object.
The
Labels,Milestone, andPullRequestproperties changed from specific types (List<IssueLabels>,IssueMilestone, specific model) to genericObjectorList<Object>. This eliminates compile-time type checking and forces consumers to perform runtime type inspection or casting, increasing the risk of runtime errors.If the OpenAPI spec genuinely requires this flexibility (e.g., polymorphic types), consider using a discriminated union or base class hierarchy instead of raw
Objectto preserve some type safety.Also applies to: 18-18
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3b4d0b16-84c3-4879-99fa-43ee3e56cadd
⛔ Files ignored due to path filters (1)
Java/gradle/wrapper/gradle-wrapper.jaris excluded by!**/*.jar
📒 Files selected for processing (299)
C#/.gitignoreC#/.swagger-codegen-ignoreC#/.swagger-codegen/VERSIONC#/.travis.ymlC#/README.mdC#/build.batC#/build.shC#/dagshub_api.slnC#/docs/BranchesApi.mdC#/docs/CollaboratorsApi.mdC#/docs/CollaboratorsCollaboratorBody.mdC#/docs/CommitsApi.mdC#/docs/ContentApi.mdC#/docs/CreateRepo.mdC#/docs/EditExperimentPost.mdC#/docs/ExperimentMetricsResponse.mdC#/docs/ExperimentsApi.mdC#/docs/ExperimentsResponse.mdC#/docs/File.mdC#/docs/Files1.mdC#/docs/HooksIdBody.mdC#/docs/IntegrationInner.mdC#/docs/Issue.mdC#/docs/IssueAssignee.mdC#/docs/IssueLabels.mdC#/docs/IssueMilestone.mdC#/docs/IssuesApi.mdC#/docs/Labels.mdC#/docs/MigrateRepo.mdC#/docs/PatchIssue.mdC#/docs/PostIssue.mdC#/docs/ReleasesApi.mdC#/docs/RepoHooksBody.mdC#/docs/RepositoryApi.mdC#/docs/StorageIntegrationsApi.mdC#/docs/User.mdC#/docs/UserApi.mdC#/docs/WebhookConfig.mdC#/docs/WebhookEvents.mdC#/docs/WebhooksApi.mdC#/git_push.shC#/mono_nunit_test.shC#/src/dagshub_api.Test/Api/BranchesApiTests.csC#/src/dagshub_api.Test/Api/CollaboratorsApiTests.csC#/src/dagshub_api.Test/Api/CommitsApiTests.csC#/src/dagshub_api.Test/Api/ContentApiTests.csC#/src/dagshub_api.Test/Api/ExperimentsApiTests.csC#/src/dagshub_api.Test/Api/IssuesApiTests.csC#/src/dagshub_api.Test/Api/ReleasesApiTests.csC#/src/dagshub_api.Test/Api/RepositoryApiTests.csC#/src/dagshub_api.Test/Api/StorageIntegrationsApiTests.csC#/src/dagshub_api.Test/Api/UserApiTests.csC#/src/dagshub_api.Test/Api/WebhooksApiTests.csC#/src/dagshub_api.Test/Model/CollaboratorsCollaboratorBodyTests.csC#/src/dagshub_api.Test/Model/CreateRepoTests.csC#/src/dagshub_api.Test/Model/EditExperimentPostTests.csC#/src/dagshub_api.Test/Model/ExperimentKeysTests.csC#/src/dagshub_api.Test/Model/ExperimentMetricsResponseTests.csC#/src/dagshub_api.Test/Model/ExperimentsResponseTests.csC#/src/dagshub_api.Test/Model/FileTests.csC#/src/dagshub_api.Test/Model/Files1Tests.csC#/src/dagshub_api.Test/Model/FilesTests.csC#/src/dagshub_api.Test/Model/HooksIdBodyTests.csC#/src/dagshub_api.Test/Model/IntegrationTests.csC#/src/dagshub_api.Test/Model/IssueAssigneeTests.csC#/src/dagshub_api.Test/Model/IssueLabelsTests.csC#/src/dagshub_api.Test/Model/IssueMilestoneTests.csC#/src/dagshub_api.Test/Model/IssueTests.csC#/src/dagshub_api.Test/Model/IssuesTests.csC#/src/dagshub_api.Test/Model/LabelsTests.csC#/src/dagshub_api.Test/Model/MigrateRepoTests.csC#/src/dagshub_api.Test/Model/PatchIssueTests.csC#/src/dagshub_api.Test/Model/PostIssueTests.csC#/src/dagshub_api.Test/Model/PutFileTests.csC#/src/dagshub_api.Test/Model/RepoHooksBodyTests.csC#/src/dagshub_api.Test/Model/StateTests.csC#/src/dagshub_api.Test/Model/UserTests.csC#/src/dagshub_api.Test/Model/WebhookConfigTests.csC#/src/dagshub_api.Test/dagshub_api.Test.csprojC#/src/dagshub_api.Test/packages.configC#/src/dagshub_api/Api/BranchesApi.csC#/src/dagshub_api/Api/CollaboratorsApi.csC#/src/dagshub_api/Api/CommitsApi.csC#/src/dagshub_api/Api/ContentApi.csC#/src/dagshub_api/Api/ExperimentsApi.csC#/src/dagshub_api/Api/IssuesApi.csC#/src/dagshub_api/Api/ReleasesApi.csC#/src/dagshub_api/Api/RepositoryApi.csC#/src/dagshub_api/Api/StorageIntegrationsApi.csC#/src/dagshub_api/Api/UserApi.csC#/src/dagshub_api/Api/WebhooksApi.csC#/src/dagshub_api/Client/ApiClient.csC#/src/dagshub_api/Client/ApiException.csC#/src/dagshub_api/Client/ApiResponse.csC#/src/dagshub_api/Client/Configuration.csC#/src/dagshub_api/Client/ExceptionFactory.csC#/src/dagshub_api/Client/GlobalConfiguration.csC#/src/dagshub_api/Client/IApiAccessor.csC#/src/dagshub_api/Client/IReadableConfiguration.csC#/src/dagshub_api/Client/SwaggerDateConverter.csC#/src/dagshub_api/Model/CollaboratorsCollaboratorBody.csC#/src/dagshub_api/Model/CreateRepo.csC#/src/dagshub_api/Model/EditExperimentPost.csC#/src/dagshub_api/Model/ExperimentKeys.csC#/src/dagshub_api/Model/ExperimentMetricsResponse.csC#/src/dagshub_api/Model/ExperimentsResponse.csC#/src/dagshub_api/Model/File.csC#/src/dagshub_api/Model/Files.csC#/src/dagshub_api/Model/Files1.csC#/src/dagshub_api/Model/HooksIdBody.csC#/src/dagshub_api/Model/Integration.csC#/src/dagshub_api/Model/IntegrationInner.csC#/src/dagshub_api/Model/Issue.csC#/src/dagshub_api/Model/IssueAssignee.csC#/src/dagshub_api/Model/IssueLabels.csC#/src/dagshub_api/Model/IssueMilestone.csC#/src/dagshub_api/Model/Issues.csC#/src/dagshub_api/Model/Labels.csC#/src/dagshub_api/Model/MigrateRepo.csC#/src/dagshub_api/Model/PatchIssue.csC#/src/dagshub_api/Model/PostIssue.csC#/src/dagshub_api/Model/PutFile.csC#/src/dagshub_api/Model/RepoHooksBody.csC#/src/dagshub_api/Model/State.csC#/src/dagshub_api/Model/User.csC#/src/dagshub_api/Model/WebhookConfig.csC#/src/dagshub_api/Properties/AssemblyInfo.csC#/src/dagshub_api/dagshub_api.csprojC#/src/dagshub_api/dagshub_api.nuspecC#/src/dagshub_api/packages.configGo/.gitignoreGo/.swagger-codegen-ignoreGo/.swagger-codegen/VERSIONGo/.travis.ymlGo/README.mdGo/api/swagger.yamlGo/api_branches.goGo/api_collaborators.goGo/api_commits.goGo/api_content.goGo/api_experiments.goGo/api_issues.goGo/api_releases.goGo/api_repository.goGo/api_storage_integrations.goGo/api_user.goGo/api_webhooks.goGo/client.goGo/configuration.goGo/docs/BranchesApi.mdGo/docs/CollaboratorsApi.mdGo/docs/CollaboratorsCollaboratorBody.mdGo/docs/CommitsApi.mdGo/docs/ContentApi.mdGo/docs/CreateRepo.mdGo/docs/EditExperimentPost.mdGo/docs/ExperimentsApi.mdGo/docs/ExperimentsResponse.mdGo/docs/File.mdGo/docs/Files1.mdGo/docs/HooksIdBody.mdGo/docs/IntegrationInner.mdGo/docs/Issue.mdGo/docs/IssueAssignee.mdGo/docs/IssueLabels.mdGo/docs/IssueMilestone.mdGo/docs/IssuesApi.mdGo/docs/MigrateRepo.mdGo/docs/PatchIssue.mdGo/docs/PostIssue.mdGo/docs/ReleasesApi.mdGo/docs/RepoHooksBody.mdGo/docs/RepositoryApi.mdGo/docs/StorageIntegrationsApi.mdGo/docs/User.mdGo/docs/UserApi.mdGo/docs/WebhookConfig.mdGo/docs/WebhooksApi.mdGo/git_push.shGo/model_collaborators_collaborator_body.goGo/model_create_repo.goGo/model_edit_experiment_post.goGo/model_experiment_keys.goGo/model_experiments_response.goGo/model_file.goGo/model_files_1.goGo/model_hooks_id_body.goGo/model_integration_inner.goGo/model_issue.goGo/model_issue_assignee.goGo/model_issue_labels.goGo/model_issue_milestone.goGo/model_migrate_repo.goGo/model_patch_issue.goGo/model_post_issue.goGo/model_put_file.goGo/model_repo_hooks_body.goGo/model_state.goGo/model_user.goGo/model_webhook_config.goGo/response.goJava/.gitignoreJava/.swagger-codegen-ignoreJava/.swagger-codegen/VERSIONJava/.travis.ymlJava/README.mdJava/build.gradleJava/build.sbtJava/docs/BranchesApi.mdJava/docs/CollaboratorsApi.mdJava/docs/CollaboratorsCollaboratorBody.mdJava/docs/CommitsApi.mdJava/docs/ContentApi.mdJava/docs/CreateRepo.mdJava/docs/EditExperimentPost.mdJava/docs/ExperimentMetricsResponse.mdJava/docs/ExperimentsApi.mdJava/docs/ExperimentsResponse.mdJava/docs/File.mdJava/docs/Files1.mdJava/docs/HooksIdBody.mdJava/docs/IntegrationInner.mdJava/docs/Issue.mdJava/docs/IssueAssignee.mdJava/docs/IssueLabels.mdJava/docs/IssueMilestone.mdJava/docs/IssuesApi.mdJava/docs/MigrateRepo.mdJava/docs/PatchIssue.mdJava/docs/PostIssue.mdJava/docs/ReleasesApi.mdJava/docs/RepoHooksBody.mdJava/docs/RepositoryApi.mdJava/docs/State.mdJava/docs/StorageIntegrationsApi.mdJava/docs/User.mdJava/docs/UserApi.mdJava/docs/WebhookConfig.mdJava/docs/WebhooksApi.mdJava/git_push.shJava/gradle.propertiesJava/gradle/wrapper/gradle-wrapper.propertiesJava/gradlewJava/gradlew.batJava/pom.xmlJava/settings.gradleJava/src/main/AndroidManifest.xmlJava/src/main/java/io/swagger/client/ApiCallback.javaJava/src/main/java/io/swagger/client/ApiClient.javaJava/src/main/java/io/swagger/client/ApiException.javaJava/src/main/java/io/swagger/client/ApiResponse.javaJava/src/main/java/io/swagger/client/Configuration.javaJava/src/main/java/io/swagger/client/GzipRequestInterceptor.javaJava/src/main/java/io/swagger/client/JSON.javaJava/src/main/java/io/swagger/client/Pair.javaJava/src/main/java/io/swagger/client/ProgressRequestBody.javaJava/src/main/java/io/swagger/client/ProgressResponseBody.javaJava/src/main/java/io/swagger/client/StringUtil.javaJava/src/main/java/io/swagger/client/api/BranchesApi.javaJava/src/main/java/io/swagger/client/api/CollaboratorsApi.javaJava/src/main/java/io/swagger/client/api/CommitsApi.javaJava/src/main/java/io/swagger/client/api/ContentApi.javaJava/src/main/java/io/swagger/client/api/ExperimentsApi.javaJava/src/main/java/io/swagger/client/api/IssuesApi.javaJava/src/main/java/io/swagger/client/api/ReleasesApi.javaJava/src/main/java/io/swagger/client/api/RepositoryApi.javaJava/src/main/java/io/swagger/client/api/StorageIntegrationsApi.javaJava/src/main/java/io/swagger/client/api/UserApi.javaJava/src/main/java/io/swagger/client/api/WebhooksApi.javaJava/src/main/java/io/swagger/client/auth/ApiKeyAuth.javaJava/src/main/java/io/swagger/client/auth/Authentication.javaJava/src/main/java/io/swagger/client/auth/HttpBasicAuth.javaJava/src/main/java/io/swagger/client/auth/OAuth.javaJava/src/main/java/io/swagger/client/auth/OAuthFlow.javaJava/src/main/java/io/swagger/client/model/CollaboratorsCollaboratorBody.javaJava/src/main/java/io/swagger/client/model/CreateRepo.javaJava/src/main/java/io/swagger/client/model/EditExperimentPost.javaJava/src/main/java/io/swagger/client/model/ExperimentKeys.javaJava/src/main/java/io/swagger/client/model/ExperimentMetricsResponse.javaJava/src/main/java/io/swagger/client/model/ExperimentsResponse.javaJava/src/main/java/io/swagger/client/model/File.javaJava/src/main/java/io/swagger/client/model/Files.javaJava/src/main/java/io/swagger/client/model/Files1.javaJava/src/main/java/io/swagger/client/model/HooksIdBody.javaJava/src/main/java/io/swagger/client/model/Integration.javaJava/src/main/java/io/swagger/client/model/IntegrationInner.javaJava/src/main/java/io/swagger/client/model/Issue.javaJava/src/main/java/io/swagger/client/model/IssueAssignee.javaJava/src/main/java/io/swagger/client/model/IssueLabels.javaJava/src/main/java/io/swagger/client/model/IssueMilestone.javaJava/src/main/java/io/swagger/client/model/Issues.javaJava/src/main/java/io/swagger/client/model/Labels.javaJava/src/main/java/io/swagger/client/model/MigrateRepo.javaJava/src/main/java/io/swagger/client/model/PatchIssue.javaJava/src/main/java/io/swagger/client/model/PostIssue.javaJava/src/main/java/io/swagger/client/model/PutFile.javaJava/src/main/java/io/swagger/client/model/RepoHooksBody.javaJava/src/main/java/io/swagger/client/model/State.javaJava/src/main/java/io/swagger/client/model/User.java
💤 Files with no reviewable changes (87)
- C#/.swagger-codegen-ignore
- C#/src/dagshub_api.Test/Model/HooksIdBodyTests.cs
- C#/docs/CollaboratorsApi.md
- C#/src/dagshub_api.Test/Api/CommitsApiTests.cs
- C#/dagshub_api.sln
- C#/git_push.sh
- C#/src/dagshub_api/Client/IApiAccessor.cs
- C#/docs/IntegrationInner.md
- C#/docs/WebhookConfig.md
- C#/src/dagshub_api.Test/Model/EditExperimentPostTests.cs
- C#/docs/IssuesApi.md
- C#/docs/CommitsApi.md
- C#/src/dagshub_api.Test/Api/UserApiTests.cs
- C#/src/dagshub_api.Test/Api/ExperimentsApiTests.cs
- C#/docs/IssueMilestone.md
- C#/docs/Labels.md
- C#/src/dagshub_api.Test/Api/BranchesApiTests.cs
- C#/src/dagshub_api/Client/IReadableConfiguration.cs
- C#/src/dagshub_api.Test/Model/FileTests.cs
- C#/docs/EditExperimentPost.md
- C#/docs/ContentApi.md
- C#/.travis.yml
- C#/docs/BranchesApi.md
- C#/src/dagshub_api/Client/SwaggerDateConverter.cs
- C#/src/dagshub_api.Test/Api/ReleasesApiTests.cs
- C#/src/dagshub_api/Model/IntegrationInner.cs
- C#/src/dagshub_api.Test/Model/IssueLabelsTests.cs
- C#/src/dagshub_api/Client/ApiResponse.cs
- C#/docs/WebhookEvents.md
- C#/src/dagshub_api.Test/Api/ContentApiTests.cs
- C#/docs/IssueAssignee.md
- C#/.gitignore
- C#/docs/IssueLabels.md
- C#/src/dagshub_api.Test/Api/WebhooksApiTests.cs
- C#/src/dagshub_api.Test/Model/WebhookConfigTests.cs
- C#/src/dagshub_api.Test/Api/RepositoryApiTests.cs
- C#/docs/HooksIdBody.md
- C#/docs/UserApi.md
- C#/docs/MigrateRepo.md
- C#/README.md
- C#/docs/ExperimentsApi.md
- C#/docs/File.md
- C#/src/dagshub_api.Test/Api/StorageIntegrationsApiTests.cs
- C#/src/dagshub_api.Test/Model/LabelsTests.cs
- C#/src/dagshub_api.Test/Model/IssueMilestoneTests.cs
- C#/src/dagshub_api.Test/Model/MigrateRepoTests.cs
- C#/docs/WebhooksApi.md
- C#/src/dagshub_api/Client/ExceptionFactory.cs
- C#/src/dagshub_api.Test/Model/RepoHooksBodyTests.cs
- C#/mono_nunit_test.sh
- C#/src/dagshub_api.Test/Api/IssuesApiTests.cs
- C#/src/dagshub_api.Test/Model/IssueAssigneeTests.cs
- C#/docs/StorageIntegrationsApi.md
- C#/docs/RepositoryApi.md
- C#/docs/CreateRepo.md
- C#/docs/CollaboratorsCollaboratorBody.md
- C#/build.bat
- C#/.swagger-codegen/VERSION
- C#/src/dagshub_api/Client/GlobalConfiguration.cs
- C#/src/dagshub_api/Client/ApiException.cs
- C#/src/dagshub_api.Test/dagshub_api.Test.csproj
- C#/docs/RepoHooksBody.md
- C#/src/dagshub_api.Test/Model/StateTests.cs
- C#/build.sh
- C#/src/dagshub_api/Api/StorageIntegrationsApi.cs
- C#/src/dagshub_api/Api/CollaboratorsApi.cs
- C#/src/dagshub_api/Model/CollaboratorsCollaboratorBody.cs
- C#/src/dagshub_api/Api/ContentApi.cs
- C#/src/dagshub_api/Model/HooksIdBody.cs
- C#/src/dagshub_api.Test/Model/CreateRepoTests.cs
- C#/src/dagshub_api/Api/BranchesApi.cs
- C#/src/dagshub_api.Test/Api/CollaboratorsApiTests.cs
- C#/src/dagshub_api/Model/CreateRepo.cs
- C#/docs/ReleasesApi.md
- C#/src/dagshub_api/Model/EditExperimentPost.cs
- C#/src/dagshub_api/Client/Configuration.cs
- C#/src/dagshub_api/Api/WebhooksApi.cs
- C#/src/dagshub_api.Test/Model/CollaboratorsCollaboratorBodyTests.cs
- C#/src/dagshub_api/Api/ExperimentsApi.cs
- C#/src/dagshub_api/Api/CommitsApi.cs
- C#/src/dagshub_api.Test/packages.config
- C#/src/dagshub_api/Api/RepositoryApi.cs
- C#/src/dagshub_api/Api/UserApi.cs
- C#/src/dagshub_api/Api/ReleasesApi.cs
- C#/src/dagshub_api/Model/File.cs
- C#/src/dagshub_api/Client/ApiClient.cs
- C#/src/dagshub_api/Api/IssuesApi.cs
📜 Review details
🔇 Additional comments (17)
C#/src/dagshub_api/Model/ExperimentKeys.cs (1)
6-6: LGTM!C#/src/dagshub_api/Model/Files.cs (1)
6-6: LGTM!Also applies to: 30-30
C#/src/dagshub_api/Model/Files1.cs (1)
36-37: LGTM!Also applies to: 47-47, 50-53
C#/docs/ExperimentMetricsResponse.md (1)
1-1: LGTM!C#/docs/ExperimentsResponse.md (1)
1-10: LGTM!C#/src/dagshub_api/Model/Integration.cs (1)
30-30: Integration: List<Object>matches the generated SDK contract (OpenAPI 1.0.3)
integrationis generated as an untyped collection across clients: C# usesIntegration : List<Object>, Java usesIntegration extends ArrayList<Object>, and JavaScript usesIntegration extends Array, consistent with swagger-codegen treating the items as genericobject(so runtime casting is expected).C#/src/dagshub_api.Test/Model/IssueTests.cs (2)
1-9: LGTM!
23-175: LGTM!C#/src/dagshub_api.Test/Model/UserTests.cs (2)
1-9: LGTM!
84-139: LGTM!C#/src/dagshub_api.Test/Model/ExperimentKeysTests.cs (1)
1-80: LGTM!C#/src/dagshub_api.Test/Model/FilesTests.cs (1)
1-72: LGTM!C#/src/dagshub_api.Test/Model/IntegrationTests.cs (1)
1-72: LGTM!C#/src/dagshub_api.Test/Model/IssuesTests.cs (1)
1-72: LGTM!C#/src/dagshub_api.Test/Model/PatchIssueTests.cs (1)
1-112: LGTM!C#/src/dagshub_api.Test/Model/PostIssueTests.cs (1)
1-120: LGTM!C#/src/dagshub_api.Test/Model/PutFileTests.cs (1)
6-6: LGTM!
| **Entries** | **List<System.IO.Stream>** | | [optional] | ||
| **Limit** | **int?** | | [optional] | ||
| **NextToken** | **string** | | [optional] | ||
| **Entries** | [**List<ComponentsschemasFileYaml>**](ComponentsschemasFileYaml.md) | | [optional] |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify ComponentsschemasFileYaml.md exists
fd -t f "ComponentsschemasFileYaml.md" "C#/docs/"Repository: DagsHub/api-clients
Length of output: 45
Fix broken schema reference for Entries
C#/docs/Files1.md(line 6) linksEntriestoComponentsschemasFileYaml.md, butC#/docs/ComponentsschemasFileYaml.mdis missing in this repo snapshot, leaving the reference dangling.- The “changed from
List<System.IO.Stream>” breaking-change claim isn’t evidenced in the repo contents provided—only the currentEntries: List<ComponentsschemasFileYaml>appears—so align the breaking-change description/migration guidance to the actual prior type/version (spec/changelog) before asserting impact.
| /// </summary> | ||
| /// <returns>JSON string presentation of the object</returns> | ||
| public string ToJson() | ||
| public override string ToJson() |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="C#/src/dagshub_api/Model/ExperimentMetricsResponse.cs"
echo "== File header =="
ls -la "$FILE" || true
echo
echo "== Snippet around line 56 =="
nl -ba "$FILE" | sed -n '35,90p'
echo
echo "== Class declaration lines =="
rg -n "class\s+ExperimentMetricsResponse" -n "$FILE" || true
echo
echo "== Any ToJson() occurrences in this file =="
rg -n "ToJson\s*\(" "$FILE" || true
echo
echo "== Search for ToJson() definition in project (broad) =="
rg -n "string\s+ToJson\s*\(" "C#/" || true
echo
echo "== Search for base class that might define virtual ToJson() =="
# Find likely base types by locating any ": " on the class line and show it
rg -n "class\s+ExperimentMetricsResponse\s*[:{]" "$FILE" || trueRepository: DagsHub/api-clients
Length of output: 276
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="C#/src/dagshub_api/Model/ExperimentMetricsResponse.cs"
echo "== Snippet around line 56 =="
cat -n "$FILE" | sed -n '45,75p'
echo
echo "== Class declaration lines =="
rg -n "class\s+ExperimentMetricsResponse" "$FILE" || true
rg -n "ExperimentMetricsResponse\s*[:{]" "$FILE" || true
echo
echo "== Any ToJson() occurrences in this file =="
rg -n "ToJson\s*\(" "$FILE" || true
echo
echo "== Search for ToJson() definition in project =="
rg -n "virtual\s+.*ToJson\s*\(" "C#/" || true
rg -n "abstract\s+.*ToJson\s*\(" "C#/" || true
rg -n "string\s+ToJson\s*\(" "C#/" || true
echo
echo "== Search for usage of override ToJson() =="
rg -n "override\s+string\s+ToJson\s*\(" "C#/" || trueRepository: DagsHub/api-clients
Length of output: 3818
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="C#/src/dagshub_api/Model/ExperimentMetricsResponse.cs"
echo "== File start (imports/namespace/inheritance context) =="
sed -n '1,80p' "$FILE" | nl -ba
echo
echo "== Look for type aliases affecting Dictionary =="
rg -n "using\s+.*Dictionary\s*=" "C#/" || true
rg -n "using\s+Dictionary\b" "C#/" || true
echo
echo "== Search for other partial declarations of ExperimentMetricsResponse =="
rg -n "partial\s+class\s+ExperimentMetricsResponse" "C#/" || true
echo
echo "== Search for project-defined Dictionary types (non-BCL) =="
rg -n "class\s+Dictionary\b" "C#/" || true
rg -n "namespace\s+.*\bDictionary\b" "C#/" || true
echo
echo "== Confirm what Dictionary symbol resolves to in this project (direct definition/alias) =="
# Show any 'Dictionary' identifier occurrences near inheritance line
sed -n '20,45p' "$FILE" | nl -baRepository: DagsHub/api-clients
Length of output: 181
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="C#/src/dagshub_api/Model/ExperimentMetricsResponse.cs"
echo "== File start (first 80 lines) =="
cat -n "$FILE" | sed -n '1,80p'
echo
echo "== Inheritance line area (lines 20-50) =="
cat -n "$FILE" | sed -n '20,55p'
echo
echo "== Search for partial declarations of ExperimentMetricsResponse =="
rg -n "partial\s+class\s+ExperimentMetricsResponse" "C#/src" || true
echo
echo "== Search for project-defined types named Dictionary (non-BCL) =="
rg -n "class\s+Dictionary\b" "C#/src" || true
rg -n "struct\s+Dictionary\b" "C#/src" || true
rg -n "interface\s+Dictionary\b" "C#/src" || true
echo
echo "== Search for virtual/abstract ToJson() implementations on any Dictionary type =="
rg -n "Dictionary\b.*(virtual|abstract)\s+string\s+ToJson\s*\(" "C#/src" || true
rg -n "(virtual|abstract)\s+string\s+ToJson\s*\(" "C#/src" || true | head -n 50Repository: DagsHub/api-clients
Length of output: 6231
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show the ToJson + surrounding class inheritance for a few models that have virtual ToJson
for f in \
"C#/src/dagshub_api/Model/User.cs" \
"C#/src/dagshub_api/Model/ExperimentsResponse.cs" \
"C#/src/dagshub_api/Model/ExperimentMetricsResponse.cs"
do
echo "==================== $f ===================="
echo "-- class line(s) --"
rg -n "public\s+partial\s+class|public\s+class|class\s+\w+\s*:" "$f" | head -n 20 || true
# Show area around the first ToJson occurrence in the file
echo "-- ToJson area (first match) --"
LINE=$(rg -n "ToJson\s*\(" "$f" | head -n 1 | cut -d: -f1 || true)
if [ -n "${LINE:-}" ]; then
start=$((LINE-15))
end=$((LINE+25))
sed -n "${start},${end}p" "$f" | cat -n
else
echo "No ToJson found"
fi
done
echo
echo "== Search for any custom Dictionary type definition (beyond BCL) =="
rg -n "namespace\s+dagshub_api\.Model[\s\S]*\b(Dictionary)\b" C#/src/dagshub_api/Model || true
rg -n "\b(using\s+Dictionary\s*=\s*)|(\btypedef\b)|(\bDictionary\s*=)" C#/src/dagshub_api || true
rg -n "\b(partial\s+class\s+Dictionary|class\s+Dictionary|struct\s+Dictionary|interface\s+Dictionary)\b" C#/src/dagshub_api || trueRepository: DagsHub/api-clients
Length of output: 6227
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Search for classes inheriting from Dictionary<,> in generated models =="
rg -n ":\s*Dictionary\s*<\s*[^,]+,\s*[^>]+\s*>" "C#/src/dagshub_api/Model" || true
echo
echo "== Search for override string ToJson() in model files =="
rg -n "override\s+string\s+ToJson\s*\(" "C#/src/dagshub_api/Model" || true
echo
echo "== Search for any custom Dictionary type definitions anywhere under C#src =="
rg -n "class\s+Dictionary\s*<" "C#/src" || true
rg -n "class\s+Dictionary\b" "C#/src" || true
rg -n "namespace\s+dagshub_api\.Model[\s\S]{0,200}class\s+Dictionary\b" "C#/src/dagshub_api" || true
echo
echo "== Inspect for any 'Dictionary' using-aliases =="
rg -n "using\s+Dictionary\b" "C#/src" || true
rg -n "using\s+([A-Za-z_][A-Za-z0-9_]*)\s*=\s*.*Dictionary" "C#/src" || trueRepository: DagsHub/api-clients
Length of output: 626
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Search for any non-generic Dictionary type definitions in C# =="
rg -n --glob 'C#/**/*.cs' "(class|struct|interface)\s+Dictionary\b" C# || true
rg -n --glob 'C#/**/*.cs' "partial\s+class\s+Dictionary\b" C# || true
rg -n --glob 'C#/**/*.cs' "using\s+Dictionary\s*=\s*" C# || true
echo
echo "== Search for any ToJson() base/virtual definitions that could make override valid =="
rg -n --glob 'C#/**/*.cs' "(virtual|abstract|override)\s+string\s+ToJson\s*\(" C# || true
echo
echo "== Confirm whether any dictionary-like base class defines ToJson() =="
rg -n --glob 'C#/**/*.cs' "class\s+\w*Dictionary\w*\s*[:{]" C# || trueRepository: DagsHub/api-clients
Length of output: 1032
Fix invalid override on ToJson() (compile blocker).
ExperimentMetricsResponse inherits Dictionary<String, Dictionary>, which has no virtual/abstract ToJson() to override; this file is also the only one using override string ToJson() (other models use public virtual string ToJson()).
Suggested fix
- public override string ToJson()
+ public string ToJson()📝 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.
| public override string ToJson() | |
| public string ToJson() |
| return | ||
| ( | ||
| this.Experiments == input.Experiments || | ||
| this.Experiments != null && | ||
| input.Experiments != null && | ||
| this.Experiments.SequenceEqual(input.Experiments) | ||
| ) && |
There was a problem hiding this comment.
Fix dictionary equality/hash contract mismatch.
At Line 115, SequenceEqual on Dictionary<string, ...> is order-sensitive. At Line 139, GetHashCode() is reference-based for the dictionary. This can make logically equal payloads compare unequal (or hash inconsistently).
Suggested fix
@@
- (
- this.Experiments == input.Experiments ||
- this.Experiments != null &&
- input.Experiments != null &&
- this.Experiments.SequenceEqual(input.Experiments)
- ) &&
+ (
+ this.Experiments == input.Experiments ||
+ this.Experiments != null &&
+ input.Experiments != null &&
+ this.Experiments.Count == input.Experiments.Count &&
+ this.Experiments.All(kvp =>
+ input.Experiments.TryGetValue(kvp.Key, out var otherVal) &&
+ Equals(kvp.Value, otherVal))
+ ) &&
@@
- if (this.Experiments != null)
- hashCode = hashCode * 59 + this.Experiments.GetHashCode();
+ if (this.Experiments != null)
+ {
+ foreach (var kvp in this.Experiments.OrderBy(k => k.Key))
+ {
+ hashCode = hashCode * 59 + kvp.Key.GetHashCode();
+ if (kvp.Value != null)
+ hashCode = hashCode * 59 + kvp.Value.GetHashCode();
+ }
+ }Also applies to: 133-143
Automated clients update due to an update in the OpenAPI description