Skip to content

Commit

Permalink
Fix analysis errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Schulte committed May 16, 2016
1 parent e518b9c commit eff510f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,23 +396,23 @@ public static bool IsCreateResourceMethod(Method method)
/// URL path that comes after the resourceProvider section.
/// </summary>
/// <param name="resourceProvider"></param>
/// <param name="methodUrlPathAfterProvider"></param>
/// <param name="methodPathAfterProvider"></param>
/// <returns></returns>
public static string GetResourceType(string resourceProvider, string methodUrlPathAfterProvider)
public static string GetResourceType(string resourceProvider, string methodPathAfterProvider)
{
if (string.IsNullOrWhiteSpace(resourceProvider))
{
throw new ArgumentException("resourceProvider cannot be null or whitespace", "resourceProvider");
}
if (string.IsNullOrWhiteSpace(methodUrlPathAfterProvider))
if (string.IsNullOrWhiteSpace(methodPathAfterProvider))
{
throw new ArgumentException("methodUrlPathAfterProvider cannot be null or whitespace", "methodUrlPathAfterProvider");
throw new ArgumentException("methodPathAfterProvider cannot be null or whitespace", "methodPathAfterProvider");
}

List<string> resourceTypeParts = new List<string>();
resourceTypeParts.Add(resourceProvider);

string[] pathSegments = methodUrlPathAfterProvider.Split(new char[] { '/' });
string[] pathSegments = methodPathAfterProvider.Split(new char[] { '/' });
for (int i = 0; i < pathSegments.Length; i += 2)
{
resourceTypeParts.Add(pathSegments[i]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void Write(TextWriter writer, ResourceSchema resourceSchema)
}
}

public static void Write(JsonTextWriter writer, ResourceSchema resourceSchema)
public static void Write(JsonWriter writer, ResourceSchema resourceSchema)
{
if (writer == null)
{
Expand All @@ -58,7 +58,7 @@ public static void Write(JsonTextWriter writer, ResourceSchema resourceSchema)
writer.WriteEndObject();
}

private static void WriteDefinitionMap(JsonTextWriter writer, string definitionMapName, IDictionary<string,JsonSchema> definitionMap, bool sortDefinitions = false, bool addExpressionReferences = false)
private static void WriteDefinitionMap(JsonWriter writer, string definitionMapName, IDictionary<string,JsonSchema> definitionMap, bool sortDefinitions = false, bool addExpressionReferences = false)
{
if (definitionMap != null && definitionMap.Count > 0)
{
Expand Down Expand Up @@ -120,16 +120,21 @@ private static void WriteDefinitionMap(JsonTextWriter writer, string definitionM
}
}

public static void WriteDefinition(JsonTextWriter writer, string resourceName, JsonSchema definition)
public static void WriteDefinition(JsonWriter writer, string resourceName, JsonSchema definition)
{
if (writer == null)
{
throw new ArgumentNullException("writer");
}

if (definition != null)
{
writer.WritePropertyName(resourceName);
WriteDefinition(writer, definition);
}
}

private static void WriteDefinition(JsonTextWriter writer, JsonSchema definition)
private static void WriteDefinition(JsonWriter writer, JsonSchema definition)
{
if (definition == null)
{
Expand All @@ -151,7 +156,7 @@ private static void WriteDefinition(JsonTextWriter writer, JsonSchema definition
writer.WriteEndObject();
}

private static void WriteStringArray(JsonTextWriter writer, string arrayName, IEnumerable<string> arrayValues)
private static void WriteStringArray(JsonWriter writer, string arrayName, IEnumerable<string> arrayValues)
{
if (arrayValues != null && arrayValues.Count() > 0)
{
Expand All @@ -165,7 +170,7 @@ private static void WriteStringArray(JsonTextWriter writer, string arrayName, IE
}
}

private static void WriteDefinitionArray(JsonTextWriter writer, string arrayName, IEnumerable<JsonSchema> arrayDefinitions)
private static void WriteDefinitionArray(JsonWriter writer, string arrayName, IEnumerable<JsonSchema> arrayDefinitions)
{
if (arrayDefinitions != null && arrayDefinitions.Count() > 0)
{
Expand All @@ -191,7 +196,7 @@ private static void WriteDefinitionArray(JsonTextWriter writer, string arrayName
}
}

public static void WriteProperty(JsonTextWriter writer, string propertyName, string propertyValue)
public static void WriteProperty(JsonWriter writer, string propertyName, string propertyValue)
{
if (writer == null)
{
Expand Down

0 comments on commit eff510f

Please sign in to comment.