yanivru commented on a change in pull request #1597:
URL: https://github.com/apache/avro/pull/1597#discussion_r838973256
##########
File path: lang/csharp/src/apache/main/Schema/EnumSchema.cs
##########
@@ -47,6 +48,35 @@ public class EnumSchema : NamedSchema
/// </summary>
public int Count { get { return Symbols.Count; } }
+ /// <summary>
+ /// Initializes a new instance of the <see cref="EnumSchema"/> class.
+ /// </summary>
+ /// <param name="name">Name of enum</param>
+ /// <param name="space">Namespace of enum</param>
+ /// <param name="aliases">List of aliases for the name</param>
+ /// <param name="symbols">List of enum symbols</param>
+ /// <param name="customProperties">Custom properties on this
schema</param>
+ /// <param name="doc">Documentation for this named schema</param>
+ /// <param name="defaultSymbol"></param>
+ public static EnumSchema Create(string name,
+ IEnumerable<string> symbols,
+ string space = null,
+ IEnumerable<string> aliases = null,
+ PropertyMap customProperties = null,
+ string doc = null,
+ string defaultSymbol = null)
Review comment:
The public method should have this parameter, it should always throw
AvroException (and not ParseException. The internal constructor can be used by
this method (public factory method) or by the NewInstance method (the json
parsing method). So I add this parameter to it to choose which exception to
throw.
But if we don't care about backward compatibility of the inner exception
(till now there was SchemaParseException inside SchemaParseException, I can
change to SchemaParseException the contains AvroException), I can remove this
kinda ugly code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]