Skip to content

Commit b9e53e0

Browse files
author
Gunpal Jain
committed
remove unused codes.
1 parent 8c68191 commit b9e53e0

File tree

2 files changed

+2
-68
lines changed

2 files changed

+2
-68
lines changed

src/libs/CSharpToJsonSchema.Generators/Conversion/ToModels.cs

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -136,72 +136,6 @@ public static InterfaceData PrepareMethodData(
136136

137137
return string.Join(".", commonParts);
138138
}
139-
140-
141-
// private static Dictionary<string, bool> GetIsRequired(IParameterSymbol[] parameters, Dictionary<string, bool>? dics = null)
142-
// {
143-
// dics ??= new Dictionary<string, bool>();
144-
//
145-
// foreach (var parameter in parameters)
146-
// {
147-
// if (dics.TryAdd(parameter.Name, IsRequired(parameter)))
148-
// {
149-
// if (parameter is IParameterSymbol namedTypeSymbol)
150-
// {
151-
// GetIsRequired(namedTypeSymbol.Type.GetMembers().OfType<IPropertySymbol>().ToArray(),dics)
152-
// }
153-
// }
154-
// }
155-
//
156-
// return dics;
157-
// }
158-
//
159-
// private static bool IsRequired(ISymbol parameter)
160-
// {
161-
// return false;
162-
// //parameter.GetAttributes().OfType<global::System.ComponentModel.D.RequiredAttribute>()
163-
// }
164-
165-
private static List<KeyValuePair<string, string>> GetParameterDescriptions(IParameterSymbol parameters,
166-
Dictionary<string, string>? dics = null)
167-
{
168-
dics ??= new Dictionary<string, string>();
169-
170-
171-
if (dics.TryAdd(parameters.Name.ToCamelCase(), GetDescription(parameters)))
172-
{
173-
if (parameters is IParameterSymbol namedTypeSymbol)
174-
{
175-
GetParameterDescriptions(namedTypeSymbol.Type.GetMembers().OfType<IPropertySymbol>().ToArray(), dics);
176-
}
177-
}
178-
179-
return dics.Select(x => new KeyValuePair<string, string>(x.Key, x.Value)).ToList();
180-
}
181-
182-
private static Dictionary<string, string> GetParameterDescriptions(IPropertySymbol[] parameters,
183-
Dictionary<string, string>? dics = null)
184-
{
185-
dics ??= new Dictionary<string, string>();
186-
187-
foreach (var parameter in parameters)
188-
{
189-
var description = GetDescription(parameter);
190-
if (string.IsNullOrWhiteSpace(description)) continue;
191-
192-
if (dics.TryAdd(parameter.Name, description))
193-
{
194-
if (parameter is IPropertySymbol namedTypeSymbol)
195-
{
196-
GetParameterDescriptions(namedTypeSymbol.Type.GetMembers().OfType<IPropertySymbol>().ToArray(),
197-
dics);
198-
}
199-
}
200-
}
201-
202-
return dics;
203-
}
204-
205139
private static OpenApiSchema ToParameterData(ITypeSymbol typeSymbol, string? name = null,
206140
string? description = null, bool isRequired = true)
207141
{

src/libs/CSharpToJsonSchema/SchemaSubsetHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ private static void FixType(JsonNode schema)
113113
else
114114
{
115115
throw new InvalidOperationException(
116-
$"Google's API for strucutured output requires every property to have one defined type, not multiple options. Path: {schema.GetPath()} Schema: {schema.ToJsonString()}");
116+
$"LLM's API for strucutured output requires every property to have one defined type, not multiple options. Path: {schema.GetPath()} Schema: {schema.ToJsonString()}");
117117
}
118118
}
119119
else if (array.Count > 2)
120120
{
121121
throw new InvalidOperationException(
122-
$"Google's API for strucutured output requires every property to have one defined type, not multiple options. Path: {schema.GetPath()} Schema: {schema.ToJsonString()}");
122+
$"LLM's API for strucutured output requires every property to have one defined type, not multiple options. Path: {schema.GetPath()} Schema: {schema.ToJsonString()}");
123123
}
124124
}
125125
}

0 commit comments

Comments
 (0)