Skip to content

Commit

Permalink
Fixed bug in DefaultValueGenerator
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoSuter committed Feb 14, 2017
1 parent 5644828 commit 898be5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/NJsonSchema.CodeGeneration/DefaultValueGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public virtual string GetDefaultValue(JsonSchema4 schema, bool allowsNull, strin
return null;

var actualSchema = schema is JsonProperty ? ((JsonProperty)schema).ActualPropertySchema : schema.ActualSchema;
if (actualSchema.IsEnumeration)
if (actualSchema.IsEnumeration && !actualSchema.Type.HasFlag(JsonObjectType.Object) && actualSchema.Type != JsonObjectType.None)
{
var typeName = _typeResolver.Resolve(actualSchema, false, typeNameHint);

Expand Down

0 comments on commit 898be5d

Please sign in to comment.