Skip to content

Commit

Permalink
fix: Fixed missing owner path parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Oct 23, 2024
1 parent 543de52 commit 58a26f7
Show file tree
Hide file tree
Showing 12 changed files with 107 additions and 12 deletions.
20 changes: 20 additions & 0 deletions src/helpers/FixOpenApiSpec/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,26 @@

var openApiDocument = new OpenApiStringReader().Read(yamlOrJson, out var diagnostics);

var ownerParameter = new OpenApiParameter
{
Name = "owner",
In = ParameterLocation.Path,
Required = true,
Schema = new OpenApiSchema
{
Type = "string"
},
};

foreach (var (_, operation) in openApiDocument.Paths["/api/v1/repos/{owner}/{repo}/tags"].Operations)
{
operation.Parameters.Add(ownerParameter);
}
foreach (var (_, operation) in openApiDocument.Paths["/api/v1/repos/{owner}/{repo}/tags/{tag_name}"].Operations)
{
operation.Parameters.Add(ownerParameter);
}

openApiDocument.Servers.Add(new OpenApiServer { Url = "https://api.smith.langchain.com" });

openApiDocument.SecurityRequirements = new List<OpenApiSecurityRequirement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,28 @@ public partial interface ITagsClient
/// Create Tag
/// </summary>
/// <param name="repo"></param>
/// <param name="owner"></param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::LangSmith.RepoTag> CreateTagAsync(
string repo,
string owner,
global::LangSmith.RepoTagRequest request,
global::System.Threading.CancellationToken cancellationToken = default);

/// <summary>
/// Create Tag
/// </summary>
/// <param name="repo"></param>
/// <param name="owner"></param>
/// <param name="tagName"></param>
/// <param name="commitId"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::LangSmith.RepoTag> CreateTagAsync(
string repo,
string owner,
string tagName,
global::System.Guid commitId,
global::System.Threading.CancellationToken cancellationToken = default);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ public partial interface ITagsClient
/// </summary>
/// <param name="repo"></param>
/// <param name="tagName"></param>
/// <param name="owner"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<string> DeleteTagAsync(
string repo,
string tagName,
string owner,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ public partial interface ITagsClient
/// </summary>
/// <param name="repo"></param>
/// <param name="tagName"></param>
/// <param name="owner"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::LangSmith.RepoTag> GetTagAsync(
string repo,
string tagName,
string owner,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ public partial interface ITagsClient
/// Get Tags
/// </summary>
/// <param name="repo"></param>
/// <param name="owner"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::System.Collections.Generic.IList<global::LangSmith.RepoTag>> GetTagsAsync(
string repo,
string owner,
global::System.Threading.CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ public partial interface ITagsClient
/// </summary>
/// <param name="repo"></param>
/// <param name="tagName"></param>
/// <param name="owner"></param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::LangSmith.RepoTag> UpdateTagAsync(
string repo,
string tagName,
string owner,
global::LangSmith.RepoUpdateTagRequest request,
global::System.Threading.CancellationToken cancellationToken = default);

Expand All @@ -23,12 +25,14 @@ public partial interface ITagsClient
/// </summary>
/// <param name="repo"></param>
/// <param name="tagName"></param>
/// <param name="owner"></param>
/// <param name="commitId"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
global::System.Threading.Tasks.Task<global::LangSmith.RepoTag> UpdateTagAsync(
string repo,
string tagName,
string owner,
global::System.Guid commitId,
global::System.Threading.CancellationToken cancellationToken = default);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ public partial class TagsClient
partial void PrepareCreateTagArguments(
global::System.Net.Http.HttpClient httpClient,
ref string repo,
ref string owner,
global::LangSmith.RepoTagRequest request);
partial void PrepareCreateTagRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string repo,
string owner,
global::LangSmith.RepoTagRequest request);
partial void ProcessCreateTagResponse(
global::System.Net.Http.HttpClient httpClient,
Expand All @@ -27,11 +29,13 @@ partial void ProcessCreateTagResponseContent(
/// Create Tag
/// </summary>
/// <param name="repo"></param>
/// <param name="owner"></param>
/// <param name="request"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::LangSmith.RepoTag> CreateTagAsync(
string repo,
string owner,
global::LangSmith.RepoTagRequest request,
global::System.Threading.CancellationToken cancellationToken = default)
{
Expand All @@ -42,6 +46,7 @@ partial void ProcessCreateTagResponseContent(
PrepareCreateTagArguments(
httpClient: HttpClient,
repo: ref repo,
owner: ref owner,
request: request);

var __pathBuilder = new PathBuilder(
Expand Down Expand Up @@ -81,6 +86,7 @@ partial void ProcessCreateTagResponseContent(
httpClient: HttpClient,
httpRequestMessage: __httpRequest,
repo: repo,
owner: owner,
request: request);

using var __response = await HttpClient.SendAsync(
Expand Down Expand Up @@ -124,12 +130,14 @@ partial void ProcessCreateTagResponseContent(
/// Create Tag
/// </summary>
/// <param name="repo"></param>
/// <param name="owner"></param>
/// <param name="tagName"></param>
/// <param name="commitId"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::LangSmith.RepoTag> CreateTagAsync(
string repo,
string owner,
string tagName,
global::System.Guid commitId,
global::System.Threading.CancellationToken cancellationToken = default)
Expand All @@ -142,6 +150,7 @@ partial void ProcessCreateTagResponseContent(

return await CreateTagAsync(
repo: repo,
owner: owner,
request: __request,
cancellationToken: cancellationToken).ConfigureAwait(false);
}
Expand Down
14 changes: 10 additions & 4 deletions src/libs/LangSmith/Generated/LangSmith.TagsClient.DeleteTag.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ public partial class TagsClient
partial void PrepareDeleteTagArguments(
global::System.Net.Http.HttpClient httpClient,
ref string repo,
ref string tagName);
ref string tagName,
ref string owner);
partial void PrepareDeleteTagRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string repo,
string tagName);
string tagName,
string owner);
partial void ProcessDeleteTagResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);
Expand All @@ -28,19 +30,22 @@ partial void ProcessDeleteTagResponseContent(
/// </summary>
/// <param name="repo"></param>
/// <param name="tagName"></param>
/// <param name="owner"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<string> DeleteTagAsync(
string repo,
string tagName,
string owner,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
PrepareDeleteTagArguments(
httpClient: HttpClient,
repo: ref repo,
tagName: ref tagName);
tagName: ref tagName,
owner: ref owner);

var __pathBuilder = new PathBuilder(
path: $"/api/v1/repos/{owner}/{repo}/tags/{tagName}",
Expand Down Expand Up @@ -73,7 +78,8 @@ partial void ProcessDeleteTagResponseContent(
httpClient: HttpClient,
httpRequestMessage: __httpRequest,
repo: repo,
tagName: tagName);
tagName: tagName,
owner: owner);

using var __response = await HttpClient.SendAsync(
request: __httpRequest,
Expand Down
14 changes: 10 additions & 4 deletions src/libs/LangSmith/Generated/LangSmith.TagsClient.GetTag.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ public partial class TagsClient
partial void PrepareGetTagArguments(
global::System.Net.Http.HttpClient httpClient,
ref string repo,
ref string tagName);
ref string tagName,
ref string owner);
partial void PrepareGetTagRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string repo,
string tagName);
string tagName,
string owner);
partial void ProcessGetTagResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);
Expand All @@ -28,19 +30,22 @@ partial void ProcessGetTagResponseContent(
/// </summary>
/// <param name="repo"></param>
/// <param name="tagName"></param>
/// <param name="owner"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::LangSmith.RepoTag> GetTagAsync(
string repo,
string tagName,
string owner,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
PrepareGetTagArguments(
httpClient: HttpClient,
repo: ref repo,
tagName: ref tagName);
tagName: ref tagName,
owner: ref owner);

var __pathBuilder = new PathBuilder(
path: $"/api/v1/repos/{owner}/{repo}/tags/{tagName}",
Expand Down Expand Up @@ -73,7 +78,8 @@ partial void ProcessGetTagResponseContent(
httpClient: HttpClient,
httpRequestMessage: __httpRequest,
repo: repo,
tagName: tagName);
tagName: tagName,
owner: owner);

using var __response = await HttpClient.SendAsync(
request: __httpRequest,
Expand Down
14 changes: 10 additions & 4 deletions src/libs/LangSmith/Generated/LangSmith.TagsClient.GetTags.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ public partial class TagsClient
{
partial void PrepareGetTagsArguments(
global::System.Net.Http.HttpClient httpClient,
ref string repo);
ref string repo,
ref string owner);
partial void PrepareGetTagsRequest(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpRequestMessage httpRequestMessage,
string repo);
string repo,
string owner);
partial void ProcessGetTagsResponse(
global::System.Net.Http.HttpClient httpClient,
global::System.Net.Http.HttpResponseMessage httpResponseMessage);
Expand All @@ -25,17 +27,20 @@ partial void ProcessGetTagsResponseContent(
/// Get Tags
/// </summary>
/// <param name="repo"></param>
/// <param name="owner"></param>
/// <param name="cancellationToken">The token to cancel the operation with</param>
/// <exception cref="global::System.InvalidOperationException"></exception>
public async global::System.Threading.Tasks.Task<global::System.Collections.Generic.IList<global::LangSmith.RepoTag>> GetTagsAsync(
string repo,
string owner,
global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
PrepareGetTagsArguments(
httpClient: HttpClient,
repo: ref repo);
repo: ref repo,
owner: ref owner);

var __pathBuilder = new PathBuilder(
path: $"/api/v1/repos/{owner}/{repo}/tags",
Expand Down Expand Up @@ -67,7 +72,8 @@ partial void ProcessGetTagsResponseContent(
PrepareGetTagsRequest(
httpClient: HttpClient,
httpRequestMessage: __httpRequest,
repo: repo);
repo: repo,
owner: owner);

using var __response = await HttpClient.SendAsync(
request: __httpRequest,
Expand Down
Loading

0 comments on commit 58a26f7

Please sign in to comment.