Our Get Salt endpoint does not accept any request bodies, but it does require a query string parameter called email, which must be set to a valid email address. Therefore, we must define a parameters property, containing a list of parameter objects. Each Parameter Object can contain the following properties:
- name* (string): The name of the parameter
- in* (string): Where the parameter is specified. Possible values are query, header, path, or cookie.
- required (boolean): Whether the parameter is required.
- schema (object): This describes the structure of the parameter:
paths:
/salt:
get:
...
parameters:
- name: email
in: query
description: The email of the user to retrieve the salt for
required: true
schema:
type: string
format: email
You might have noticed that the OpenAPI syntax for defining schema looks a lot like JSON Schema. This is because OpenAPI Specification is actually based on the first drafts of the JSON Schema specification.