Generate complete OpenAPI 3.0 documentation with schemas, examples, and error responses.

Prompt

Generate OpenAPI 3.0 documentation for the following API endpoint.

Include:
- Summary and description
- Request parameters (path, query, header)
- Request body schema with examples
- Response schemas for success and error cases
- Authentication requirements

Endpoint details:
[DESCRIBE YOUR ENDPOINT HERE]

Output format: YAML

Example

Input:

POST /api/users
Creates a new user account
Requires: name, email, password
Returns: user object with id
Auth: API key in header

Output:

/api/users:
  post:
    summary: Create a new user
    description: Creates a new user account with the provided details
    security:
      - ApiKeyAuth: []
    requestBody:
      required: true
      content:
        application/json:
          schema:
            type: object
            required: [name, email, password]
            properties:
              name:
                type: string
                example: "John Doe"
              email:
                type: string
                format: email
                example: "john@example.com"
              password:
                type: string
                format: password
                minLength: 8
    responses:
      '201':
        description: User created successfully
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/User'
      '400':
        description: Invalid input
      '409':
        description: Email already exists