@@ -228,7 +228,7 @@ internal static Schema ParseJson(JToken jtok, SchemaNames names, string encspace
228228 public static Schema Parse ( string json )
229229 {
230230 if ( string . IsNullOrEmpty ( json ) ) throw new ArgumentNullException ( nameof ( json ) , "json cannot be null." ) ;
231- return Parse ( json . Trim ( ) , new SchemaNames ( ) , null ) ; // standalone schema, so no enclosing namespace
231+ return ParseInternal ( json . Trim ( ) , new SchemaNames ( ) , null ) ; // standalone schema, so no enclosing namespace
232232 }
233233
234234 /// <summary>
@@ -238,7 +238,20 @@ public static Schema Parse(string json)
238238 /// <param name="names">list of named schemas already read</param>
239239 /// <param name="encspace">enclosing namespace of the schema</param>
240240 /// <returns>new Schema object</returns>
241- internal static Schema Parse ( string json , SchemaNames names , string encspace )
241+ public static Schema Parse ( string json , SchemaNames names , string encspace = null )
242+ {
243+ if ( string . IsNullOrEmpty ( json ) ) throw new ArgumentNullException ( nameof ( json ) , "json cannot be null." ) ;
244+ return ParseInternal ( json . Trim ( ) , names , encspace ) ; // standalone schema, so no enclosing namespace
245+ }
246+
247+ /// <summary>
248+ /// Parses a JSON string to create a new schema object
249+ /// </summary>
250+ /// <param name="json">JSON string</param>
251+ /// <param name="names">list of named schemas already read</param>
252+ /// <param name="encspace">enclosing namespace of the schema</param>
253+ /// <returns>new Schema object</returns>
254+ internal static Schema ParseInternal ( string json , SchemaNames names , string encspace )
242255 {
243256 Schema sc = PrimitiveSchema . NewInstance ( json ) ;
244257 if ( null != sc ) return sc ;
0 commit comments