Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/LEGO.AsyncAPI.Readers/V2/AsyncApiSchemaDeserializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ public class JsonSchemaDeserializer
{
"enum", (a, n) => { a.Enum = n.CreateListOfAny(); }
},
{
"const", (a, n) => { a.Const = n.CreateAny(); }
Comment thread
VisualBean marked this conversation as resolved.
},
{
"examples", (a, n) => { a.Examples = n.CreateListOfAny(); }
},
Expand Down
12 changes: 11 additions & 1 deletion test/LEGO.AsyncAPI.Tests/Models/AsyncApiSchema_Should.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ public class AsyncApiSchema_Should
},
},
},
["property9"] = new AsyncApiSchema
{
Const = new AsyncApiString("aSpecialConstant"),
},
},
Nullable = true,
ExternalDocs = new AsyncApiExternalDocumentation
Expand Down Expand Up @@ -418,6 +422,9 @@ public void SerializeAsJson_WithAdvancedSchemaObject_V2Works()
}
}
}
},
""property9"": {
""const"": ""aSpecialConstant""
}
},
""nullable"": true,
Expand Down Expand Up @@ -478,6 +485,9 @@ public void Deserialize_WithAdditionalProperties_Works()
}
}
}
},
""property9"": {
""const"": ""aSpecialConstant""
}
},
""nullable"": true,
Expand Down Expand Up @@ -596,7 +606,7 @@ public void Serialize_WithInliningOptions_ShouldInlineAccordingly(bool shouldInl
{ "testD", new AsyncApiSchema { Reference = new AsyncApiReference { Type = ReferenceType.Schema, Id = "testD" } } },
},
})
.WithComponent("testB", new AsyncApiSchema() { Description = "test", Type = SchemaType.Boolean })
.WithComponent("testB", new AsyncApiSchema() { Description = "test", Type = SchemaType.Boolean })
.Build();

var outputString = new StringWriter(CultureInfo.InvariantCulture);
Expand Down