我似乎无法让const或enum作为if-然后-否则JSON模式验证的一部分工作。这是我的JSON模式 "$schema": "http://json-schema.org/draft-07/schema#", "description": "A schema for validating a test object",
"type
paths//api/TodoItems/get/responses/400/content/application/json/schema/definitions/Exception'.
1> at NJsonSchema.JsonReferenceResolver.ResolveDocumentReference(Object rootObject, String jsonPath, Type targetType, IContrac
此时我们正在评估NJsonSchema库,看看它是否抛出重复属性错误。但是看起来它不支持这个验证。我们还检查了NewtonSoft的JSON模式验证器,但它似乎也不支持重复的属性验证。下面是我们使用的NJsonSchema的最小化代码-public class MyRequest [JsonRequired]或者有没有为重复属性提供JSON验证的.net core库,或者这可以使用NJsonSchema或NewtonSoft来完成。
NJsonSchema在许多方面都是完美的,但是我无法找到一种在生成时废除属性JsonProperty的方法。 }//----------------------// Generated using the NJsonSchemav11.0.0.0 (Newtonsoft.Json v13.0.0.0) (http