Skip to content

Commit

Permalink
fix: Fixed constantly updating examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Sep 16, 2024
1 parent fd51a7f commit 5b0b61f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
6 changes: 4 additions & 2 deletions src/helpers/FixOpenApiSpec/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.OpenApi;
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Extensions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Readers;
Expand All @@ -14,7 +13,10 @@

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

//openApiDocument.Components.Schemas["GenerateCompletionRequest"]!.Properties["stream"]!.Default = new OpenApiBoolean(true);
openApiDocument.Components.Schemas["ImageDoc"]!.Properties["id"].Example = null;
openApiDocument.Components.Schemas["api_schemas__embedding__TextDoc"]!.Properties["id"].Example = null;
openApiDocument.Components.Schemas["api_schemas__rank__TextDoc"]!.Properties["id"].Example = null;

openApiDocument.SecurityRequirements = new List<OpenApiSecurityRequirement>
{
new()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ namespace Jina
public sealed partial class ApiSchemasEmbeddingTextDoc
{
/// <summary>
/// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value<br/>
/// Example: 4832d7aa75c02fe80ea8dbd67051421e
/// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("id")]
public string? Id { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ namespace Jina
public sealed partial class ApiSchemasRankTextDoc
{
/// <summary>
/// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value<br/>
/// Example: 4832d7aa75c02fe80ea8dbd67051421e
/// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("id")]
public string? Id { get; set; }
Expand Down
3 changes: 1 addition & 2 deletions src/libs/Jina/Generated/Jina.Models.ImageDoc.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ namespace Jina
public sealed partial class ImageDoc
{
/// <summary>
/// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value<br/>
/// Example: 4832d7aa75c02fe80ea8dbd67051421e
/// The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("id")]
public string? Id { get; set; }
Expand Down
3 changes: 0 additions & 3 deletions src/libs/Jina/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ components:
title: Id
type: string
description: 'The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value'
example: 4832d7aa75c02fe80ea8dbd67051421e
url:
title: Url
maxLength: 65536
Expand Down Expand Up @@ -790,7 +789,6 @@ components:
title: Id
type: string
description: 'The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value'
example: 4832d7aa75c02fe80ea8dbd67051421e
text:
title: Text
type: string
Expand Down Expand Up @@ -820,7 +818,6 @@ components:
title: Id
type: string
description: 'The ID of the BaseDoc. This is useful for indexing in vector stores. If not set by user, it will automatically be assigned a random value'
example: 4832d7aa75c02fe80ea8dbd67051421e
text:
title: Text
type: string
Expand Down

0 comments on commit 5b0b61f

Please sign in to comment.