Specifying parameters

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 ...

Get Building Enterprise JavaScript Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.