.yaml
我在文件中尝试了两种方式,
email:
name: email
description: Client email
required: true
type: string
format: email
in: formData
email:
name: email
description: Client email
required: true
type: email
in: formData
有人能指出正确的方法吗?
.yaml
我在文件中尝试了两种方式,
email:
name: email
description: Client email
required: true
type: string
format: email
in: formData
email:
name: email
description: Client email
required: true
type: email
in: formData
有人能指出正确的方法吗?
在模式中,您必须输入示例的值。有时电子邮件格式没有得到很好的解释,它发生在我使用 Swashbuckle Nuget 库时。我的意思是,即使格式是电子邮件,它也不会在 Swagger-UI 中生成正确的示例值。
email:
name: email
description: Client email
required: true
type: string
format: email
example: user@example.com
in: formData
名称只是任何资源的一个字段。例如,如果您有一个用户,则定义将如下所示:
User:
title: Simple user
type: object
properties:
email:
type: string
format: email
password:
type: string
请参阅此发行说明
它表示默认情况下禁用格式验证,对于更复杂的格式(例如电子邮件地址),支持可能仍会有很大差异。目前还不清楚有多少实现曾经提供过这种级别的支持。