From c79d5cfe1c86157dd25ceb827aad87d947ea08e0 Mon Sep 17 00:00:00 2001 From: Albie Spriddell Date: Thu, 21 Nov 2024 14:24:34 +0000 Subject: [PATCH] add missing access setter (closes #145) --- DragonFruit.Data.Roslyn/ApiRequestSourceBuilder.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/DragonFruit.Data.Roslyn/ApiRequestSourceBuilder.cs b/DragonFruit.Data.Roslyn/ApiRequestSourceBuilder.cs index 27c2698..220f587 100644 --- a/DragonFruit.Data.Roslyn/ApiRequestSourceBuilder.cs +++ b/DragonFruit.Data.Roslyn/ApiRequestSourceBuilder.cs @@ -36,8 +36,16 @@ public static SourceText Build(INamedTypeSymbol classSymbol, RequestSymbolMetada { // classes are partial by default var classBuilder = new ClassBuilder() + .AddImplements("global::DragonFruit.Data.Requests.IRequestBuilder") .SetName(classSymbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat)) - .AddImplements("global::DragonFruit.Data.Requests.IRequestBuilder"); + .SetAccessModifier(classSymbol.DeclaredAccessibility switch + { + Accessibility.Public => AccessModifier.Public, + Accessibility.Internal => AccessModifier.Internal, + Accessibility.Private => AccessModifier.Private, + + _ => AccessModifier.Protected + }); var serializerMethodParamBuilder = new ParameterBuilder() .SetType("global::DragonFruit.Data.Serializers.SerializerResolver")