Intermediate Reading #openapi #swagger #schema

Reading OpenAPI/Swagger Schemas

5 exercises on reading OpenAPI/Swagger schemas — required vs optional fields, types, enums, nullable values, $ref and constraints.

Key patterns
  • required: [...] lists mandatory fields; properties alone does not mean required
  • enum = a closed whitelist of allowed values
  • $ref: "#/components/schemas/X" points to a reusable schema in the same file
  • nullable: true means null is allowed; constraints like minItems / minLength are enforced
0 / 5 completed
1 / 5
Read this OpenAPI request-body schema:

CreateUser:
  type: object
  required:
    - email
    - password
  properties:
    email:
      type: string
      format: email
    password:
      type: string
      minLength: 8
    displayName:
      type: string
According to the schema, which field is optional when creating a user?