I'm trying to get the format identifier printed on the Swagger UI which is stated on their homepage. In the auto-generated json file it should look like in this example:
我希望通过我的视图模型类中的XML注释来实现这一点.这对example
、summary
等标签很有效,但没有format
这样的标签.我必须说明的是,我们在API中等待的字符串必须是某种格式.
类似的问题也被问到了here,但格式识别符还没有答案.
我怎样才能做到这一点呢? 使用的版本:.NET7和Swashbakle v6.4.0.
我的视图模型如下所示:
public class MeasurementViewModel {
/// <example>20.01.2003</example>
/// <format>dd.mm.yyyy</format> <-- this is what I would expect but doesn't have any effect
[JsonProperty("patient_birthdate")] public string? PatientDateOfBirth { get; set; }
}