Generate ( JsonSchema schema, String type_name_hint, IEnumerable <String> reserved_type_names ) { var name = type_name_hint; if (String.IsNullOrWhiteSpace(name) && schema.HasTypeNameTitle) { name = schema.Title; } if (String.IsNullOrWhiteSpace(name) && !String.IsNullOrWhiteSpace(schema.DocumentPath)) { name = Path.GetFileNameWithoutExtension(schema.DocumentPath); } name = InvalidCharacters.RemoveAndReplace(name); var start = name; var suffix = 1; while (reserved_type_names.Contains(name)) { name = start + suffix++; } return(name); }
Generate ( Int32 index, String name, Object value, JsonSchema schema ) => InvalidCharacters.RemoveAndReplace(name);
Generate ( JsonSchemaProperty property ) => InvalidCharacters.RemoveAndReplace(property.Name);