openapi: 3.0.3
info:
  title: Michael Ditter AI Strategy API
  description: API for accessing AI strategy content, blog posts, and resources
  version: 1.0.0
  contact:
    email: mjditter@gmail.com
  license:
    name: MIT
servers:
  - url: https://michaelditter.com/api
    description: Production server

paths:
  /blog/posts:
    get:
      summary: Get all blog posts
      description: Retrieve a list of all published blog posts with metadata
      operationId: getBlogPosts
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BlogPost'
      tags:
        - Blog

  /blog/posts/{slug}:
    get:
      summary: Get blog post by slug
      description: Retrieve a specific blog post by its slug identifier
      operationId: getBlogPost
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
          description: The blog post slug
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlogPost'
        '404':
          description: Blog post not found
      tags:
        - Blog

  /resources:
    get:
      summary: Get all resources
      description: Retrieve a list of all available resources including guides, PDFs, and tools
      operationId: getResources
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Resource'
      tags:
        - Resources

  /screenwriting-masterclass:
    get:
      summary: Get screenwriting masterclass content
      description: Retrieve the complete screenwriting masterclass including video content and scene breakdowns
      operationId: getScreenwritingMasterclass
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Masterclass'
      tags:
        - Video Content

components:
  schemas:
    BlogPost:
      type: object
      properties:
        slug:
          type: string
          description: Unique identifier for the blog post
        title:
          type: string
          description: The blog post title
        excerpt:
          type: string
          description: Short description or excerpt
        content:
          type: string
          description: Full HTML content of the blog post
        author:
          $ref: '#/components/schemas/Author'
        publishedAt:
          type: string
          format: date-time
          description: Publication date
        readingTime:
          type: string
          description: Estimated reading time
        tags:
          type: array
          items:
            type: string
          description: Content tags
        category:
          type: string
          description: Content category
        featuredImage:
          $ref: '#/components/schemas/Image'
        keywords:
          type: array
          items:
            type: string
          description: SEO keywords

    Resource:
      type: object
      properties:
        id:
          type: integer
          description: Resource ID
        title:
          type: string
          description: Resource title
        description:
          type: string
          description: Resource description
        type:
          type: string
          enum: [guide, premium, article, tool]
          description: Type of resource
        category:
          type: string
          description: Resource category
        topics:
          type: array
          items:
            type: string
          description: Related topics
        downloadUrl:
          type: string
          description: Download URL for the resource
        linkUrl:
          type: string
          description: External link URL

    Masterclass:
      type: object
      properties:
        title:
          type: string
          description: Masterclass title
        description:
          type: string
          description: Masterclass description
        content:
          type: string
          description: Full HTML content
        videoUrl:
          type: string
          description: Video content URL
        author:
          $ref: '#/components/schemas/Author'
        tags:
          type: array
          items:
            type: string
        duration:
          type: string
          description: Video duration

    Author:
      type: object
      properties:
        name:
          type: string
          description: Author name
        avatar:
          type: string
          description: Author avatar URL
        title:
          type: string
          description: Author title/role

    Image:
      type: object
      properties:
        src:
          type: string
          description: Image URL
        alt:
          type: string
          description: Image alt text
        width:
          type: integer
          description: Image width
        height:
          type: integer
          description: Image height

  tags:
    - name: Blog
      description: Blog posts and articles
    - name: Resources
      description: Educational resources and tools
    - name: Video Content
      description: Video masterclasses and tutorials