mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-21 06:27:29 -05:00
fix generator
This commit is contained in:
parent
fa460f0031
commit
a1b8ef429e
|
|
@ -190,6 +190,10 @@ namespace UniGLTF.JsonSchema
|
|||
var key = prop.Key.GetString();
|
||||
var propJsonPath = $"{jsonPath}.{key}";
|
||||
var propSchema = Parse(prop.Value, propJsonPath);
|
||||
if (string.IsNullOrEmpty(propSchema.title))
|
||||
{
|
||||
propSchema.title = key.ToUpperCamel();
|
||||
}
|
||||
if (propSchema is null)
|
||||
{
|
||||
if (source.baseSchema is null)
|
||||
|
|
|
|||
|
|
@ -48,9 +48,9 @@ namespace UniGLTF.JsonSchema.Schemas
|
|||
public static $0 $2(JsonNode parsed)
|
||||
{
|
||||
var value = new $1();
|
||||
foreach(var (k, v) in parsed.ObjectItems())
|
||||
foreach(var kv in parsed.ObjectItems())
|
||||
{
|
||||
value.Add($3);
|
||||
value.Add(kv.Key.GetString(), $3);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ public static $0 $2(JsonNode parsed)
|
|||
.Replace("$0", ValueType)
|
||||
.Replace("$1", ValueType)
|
||||
.Replace("$2", callName)
|
||||
.Replace("$3", AdditionalProperties.GenerateDeserializerCall(itemCallName, "v"))
|
||||
.Replace("$3", AdditionalProperties.GenerateDeserializerCall(itemCallName, "kv.Value"))
|
||||
);
|
||||
|
||||
}
|
||||
|
|
@ -83,13 +83,13 @@ public static void {callName}(JsonFormatter f, {ValueType} value)
|
|||
{{
|
||||
f.BeginMap();
|
||||
|
||||
foreach(var (k, v) in value)
|
||||
foreach(var kv in value)
|
||||
{{
|
||||
f.Key(k);
|
||||
f.Key(kv.Key);
|
||||
"
|
||||
);
|
||||
|
||||
writer.Write($"{AdditionalProperties.GenerateSerializerCall(itemCallName, "v")};\n");
|
||||
writer.Write($"{AdditionalProperties.GenerateSerializerCall(itemCallName, "kv.Value")};\n");
|
||||
|
||||
writer.Write(@"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ namespace UniGLTF.JsonSchema.Schemas
|
|||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(prop.Title))
|
||||
{
|
||||
prop.Title = kv.Key.ToUpperCamel();
|
||||
}
|
||||
|
||||
var key = kv.Key;
|
||||
Properties.Add(key, prop);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2309,7 +2309,7 @@ public static Expressions Deserialize_Expressions(JsonNode parsed)
|
|||
return value;
|
||||
}
|
||||
|
||||
public static Preset __expressions_Deserialize_Preset(JsonNode parsed)
|
||||
public static Preset __expressions_Deserialize_Preset(JsonNode parsed)
|
||||
{
|
||||
var value = new Preset();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user