openapi: 3.1.0
info:
  title: Intelligo Public API
  version: 1.0.0
  description: Public read-only endpoints for blog and shop discovery.
servers:
  - url: /api
    description: Primary API base
  - url: /api/v1
    description: Versioned API base
tags:
  - name: Shop
  - name: Blog
paths:
  /products:
    get:
      tags: [Shop]
      operationId: listProducts
      summary: List shop products
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                oneOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/Product'
                  - type: object
                    additionalProperties: true
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Product'
                      products:
                        type: array
                        items:
                          $ref: '#/components/schemas/Product'
  /products/{id}:
    get:
      tags: [Shop]
      operationId: getProduct
      summary: Get product by ID
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /blog/posts:
    get:
      tags: [Blog]
      operationId: listBlogPosts
      summary: List blog posts
      parameters:
        - in: query
          name: page
          schema:
            type: integer
            minimum: 1
        - in: query
          name: per_page
          schema:
            type: integer
            minimum: 1
            maximum: 100
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                oneOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/BlogPost'
                  - type: object
                    additionalProperties: true
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/BlogPost'
                      posts:
                        type: array
                        items:
                          $ref: '#/components/schemas/BlogPost'
  /blog/posts/{slug}:
    get:
      tags: [Blog]
      operationId: getBlogPostBySlug
      summary: Get blog post by slug
      parameters:
        - in: path
          name: slug
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /blog/categories:
    get:
      tags: [Blog]
      operationId: listBlogCategories
      summary: List blog categories
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                oneOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/BlogCategory'
                  - type: object
                    additionalProperties: true
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/BlogCategory'
                      categories:
                        type: array
                        items:
                          $ref: '#/components/schemas/BlogCategory'
  /blog/categories/{slug}:
    get:
      tags: [Blog]
      operationId: listBlogPostsByCategory
      summary: List blog posts by category slug
      parameters:
        - in: path
          name: slug
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
components:
  schemas:
    Product:
      type: object
      additionalProperties: true
      properties:
        id:
          type: integer
        name:
          type: string
        description:
          type: string
        price:
          oneOf:
            - type: number
            - type: string
    BlogPost:
      type: object
      additionalProperties: true
      properties:
        id:
          type: integer
        title:
          type: string
        slug:
          type: string
        excerpt:
          type: string
        content:
          type: string
    BlogCategory:
      type: object
      additionalProperties: true
      properties:
        id:
          type: integer
        name:
          type: string
        slug:
          type: string
