@@ -324,7 +324,7 @@ CodeTypeDeclaration TypeToCodeTypeDeclaration(Type type, CodeNamespaceEx clientN
324
324
bool isRequired = cherryType == CherryType . BigCherry ;
325
325
if ( isRequired )
326
326
{
327
- clientProperty . CustomAttributes . Add ( new CodeAttributeDeclaration ( "System.ComponentModel.DataAnnotations.RequiredAttribute " ) ) ;
327
+ clientProperty . CustomAttributes . Add ( new CodeAttributeDeclaration ( "System.ComponentModel.DataAnnotations.Required " ) ) ;
328
328
}
329
329
330
330
if ( codeGenOutputsSettings . DataAnnotationsEnabled )
@@ -369,7 +369,7 @@ CodeTypeDeclaration TypeToCodeTypeDeclaration(Type type, CodeNamespaceEx clientN
369
369
bool isRequired = cherryType == CherryType . BigCherry ;
370
370
if ( isRequired )
371
371
{
372
- clientProperty . CustomAttributes . Add ( new CodeAttributeDeclaration ( "System.ComponentModel.DataAnnotations.RequiredAttribute " ) ) ;
372
+ clientProperty . CustomAttributes . Add ( new CodeAttributeDeclaration ( "System.ComponentModel.DataAnnotations.Required " ) ) ;
373
373
}
374
374
375
375
if ( codeGenOutputsSettings . DataAnnotationsEnabled )
@@ -419,7 +419,7 @@ CodeTypeDeclaration TypeToCodeTypeDeclaration(Type type, CodeNamespaceEx clientN
419
419
420
420
if ( codeGenOutputsSettings . DecorateDataModelWithSerializable )
421
421
{
422
- typeDeclaration . CustomAttributes . Add ( new CodeAttributeDeclaration ( "System.SerializableAttribute " ) ) ;
422
+ typeDeclaration . CustomAttributes . Add ( new CodeAttributeDeclaration ( "System.Serializable " ) ) ;
423
423
}
424
424
}
425
425
else if ( type . IsEnum )
@@ -431,7 +431,7 @@ CodeTypeDeclaration TypeToCodeTypeDeclaration(Type type, CodeNamespaceEx clientN
431
431
CustomAttributeData newtonJsonConverterAttributeData = type . CustomAttributes . FirstOrDefault ( d => d . AttributeType . FullName == "Newtonsoft.Json.JsonConverterAttribute" ) ;
432
432
if ( newtonJsonConverterAttributeData != null )
433
433
{
434
- typeDeclaration . CustomAttributes . Add ( new CodeAttributeDeclaration ( codeGenOutputsSettings . UseSystemTextJson ? "System.Text.Json.Serialization.JsonConverterAttribute " : "Newtonsoft.Json.JsonConverterAttribute " , new CodeAttributeArgument ( new CodeSnippetExpression ( codeGenOutputsSettings . UseSystemTextJson ? "typeof(System.Text.Json.Serialization.JsonStringEnumConverter)" : "typeof(Newtonsoft.Json.Converters.StringEnumConverter)" ) ) ) ) ;
434
+ typeDeclaration . CustomAttributes . Add ( new CodeAttributeDeclaration ( codeGenOutputsSettings . UseSystemTextJson ? "System.Text.Json.Serialization.JsonConverter " : "Newtonsoft.Json.JsonConverter " , new CodeAttributeArgument ( new CodeSnippetExpression ( codeGenOutputsSettings . UseSystemTextJson ? "typeof(System.Text.Json.Serialization.JsonStringEnumConverter)" : "typeof(Newtonsoft.Json.Converters.StringEnumConverter)" ) ) ) ) ;
435
435
}
436
436
437
437
CustomAttributeData systemJsonConverterAttributeData = type . CustomAttributes . FirstOrDefault ( d => d . AttributeType . FullName == "System.Text.Json.Serialization.JsonConverterAttribute" ) ;
@@ -473,7 +473,7 @@ CodeTypeDeclaration TypeToCodeTypeDeclaration(Type type, CodeNamespaceEx clientN
473
473
474
474
if ( codeGenOutputsSettings . DecorateDataModelWithSerializable )
475
475
{
476
- typeDeclaration . CustomAttributes . Add ( new CodeAttributeDeclaration ( "System.SerializableAttribute " ) ) ;
476
+ typeDeclaration . CustomAttributes . Add ( new CodeAttributeDeclaration ( "System.Serializable " ) ) ;
477
477
}
478
478
}
479
479
else
@@ -690,7 +690,7 @@ CodeMemberField CreateProperty(string name, Type type, string defaultValue)
690
690
691
691
if ( ! String . IsNullOrEmpty ( defaultValue ) )
692
692
{
693
- result . CustomAttributes . Add ( new CodeAttributeDeclaration ( "System.ComponentModel.DefaultValueAttribute " , new CodeAttributeArgument ( new CodeSnippetExpression ( defaultValue ) ) ) ) ;
693
+ result . CustomAttributes . Add ( new CodeAttributeDeclaration ( "System.ComponentModel.DefaultValue " , new CodeAttributeArgument ( new CodeSnippetExpression ( defaultValue ) ) ) ) ;
694
694
}
695
695
696
696
@@ -782,7 +782,7 @@ public string TranslateToClientTypeReferenceText(Type type, bool forDocComment)
782
782
if ( type . FullName == "System.Net.Http.HttpResponseMessage" )
783
783
return "System.Net.Http.HttpResponseMessage" ;
784
784
785
- if ( type . FullName == "System.Object" && ( type . Attributes & TypeAttributes . Serializable ) == TypeAttributes . Serializable )
785
+ if ( type . FullName == "System.Object" ) // && (type.Attributes & TypeAttributes.Serializable) == TypeAttributes.Serializable)
786
786
return codeGenOutputsSettings . UseSystemTextJson ? "System.Text.Json.Nodes.JsonObject" : "Newtonsoft.Json.Linq.JObject" ;
787
787
}
788
788
0 commit comments