Reputation: 618
I tried with both way in .yaml
file ,
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
can some one point out the correct way?
Upvotes: 1
Views: 12104
Reputation: 368
Please refer This release note
It says that by default format validation is disabled and for more complex formats such as email addresses, support will probably still vary significantly. It’s unclear how many implementations have ever provided this level of support.
Upvotes: 0
Reputation: 310
At the schema, you have to put the value of the example. Sometimes the email format is not interpreted well, it happens me with the Swashbuckle Nuget library. I mean, even if the format is email, it wouldn't generate the right example value in Swagger-UI.
email:
name: email
description: Client email
required: true
type: string
format: email
example: [email protected]
in: formData
Upvotes: 2
Reputation: 161
Name is only a field of any resource. If you have a user, for example, the definition will be like this:
User:
title: Simple user
type: object
properties:
email:
type: string
format: email
password:
type: string
Upvotes: 1