From 31448dcf03274e3760cf27ea838b56c86fa9591d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Tue, 29 Oct 2024 14:16:40 +0100 Subject: [PATCH] * Forgot to commit --- .../fcl-jsonschema/src/fpjson.schema.codegen.pp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/fcl-jsonschema/src/fpjson.schema.codegen.pp b/packages/fcl-jsonschema/src/fpjson.schema.codegen.pp index d8c7ffc043..3b8d027af7 100644 --- a/packages/fcl-jsonschema/src/fpjson.schema.codegen.pp +++ b/packages/fcl-jsonschema/src/fpjson.schema.codegen.pp @@ -201,7 +201,7 @@ begin For I:=0 to aType.PropertyCount-1 do begin lProp:=aType.Properties[i]; - if lProp.PropertyType=ptAPIComponent then + if lProp.PropertyType=ptSchemaStruct then begin if lProp.TypeData.HasObjectProperty(True) then lConstructor:='CreateWithMembers' @@ -295,7 +295,7 @@ end; function TSerializerCodeGenerator.FieldToJSON(aType: TPropertyType; aFieldName : String): string; begin - if aType in [ptStructure,ptAPIComponent] then + if aType in [ptStructure,ptSchemaStruct] then begin Result := Format('%s.SerializeObject', [aFieldName]); end @@ -346,7 +346,7 @@ var begin if aKeyName='features' then Writeln('a'); - if aType in [ptAPIComponent,ptStructure] then + if aType in [ptSchemaStruct,ptStructure] then begin Result := Format('%s.Deserialize(%s)', [aPropertyTypeName, ObjectField(aKeyName)]); end @@ -390,7 +390,7 @@ var begin if aPropertyTypeName='' then Writeln('aPropertyTypeName is empty for ',aFieldName); - if aType in [ptStructure,ptAPIComponent] then + if aType in [ptStructure,ptSchemaStruct] then Result := Format('%s.Deserialize(%s as TJSONObject)', [aPropertyTypeName, aFieldName]) else begin @@ -444,7 +444,7 @@ begin lFieldName := aProperty.PascalName; lValue := FieldToJSON(aProperty); lType:=aProperty.PropertyType; - lNilCheck:=WriteClassType and (lType in [ptJSON,ptStructure,ptAPIComponent]); + lNilCheck:=WriteClassType and (lType in [ptJSON,ptStructure,ptSchemaStruct]); case lType of ptEnum: begin @@ -464,7 +464,7 @@ begin ptFloat32, ptFloat64, ptJSON, - ptAPIComponent: + ptSchemaStruct: begin if lNilCheck then begin @@ -529,7 +529,7 @@ begin ptBoolean, ptStructure, ptJSON, - ptAPIComponent: + ptSchemaStruct: Addln('Result.%s:=%s;', [lFieldName, lValue]); ptArray: begin