openapi: 3.1.0
info:
  title: "Motores Baldor API"
  version: 1.0.1
  description: "OpenAPI proxy to key WordPress REST endpoints."
servers:
  - 
    url: "https://motoresbaldor.com/wp-json/wp/v2"
paths:
  /posts:
    get:
      summary: "List blog posts"
      parameters:
        - 
          name: search
          in: query
          schema:
            type: string
        - 
          name: per_page
          in: query
          schema:
            type: integer
            default: 10
            minimum: 1
            maximum: 100
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/WPPost"
              examples:
                sample:
                  value:
                    - 
                      id: 123
                      date: "2025-07-15T21:15:22-06:00"
                      link: "https://powerdepot.com.mx/ejemplo/"
                      title:
                        rendered: "Guía de bombas"
                      excerpt:
                        rendered: "Resumen de ejemplo del contenido."
  /pages:
    get:
      summary: "List pages"
      parameters:
        - 
          name: search
          in: query
          schema:
            type: string
        - 
          name: per_page
          in: query
          schema:
            type: integer
            default: 10
            minimum: 1
            maximum: 100
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/WPPage"
  /products:
    get:
      summary: "List WooCommerce products"
      parameters:
        - 
          name: search
          in: query
          schema:
            type: string
        - 
          name: per_page
          in: query
          schema:
            type: integer
            default: 10
            minimum: 1
            maximum: 100
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/WPProduct"
components:
  schemas:
    WPPost:
      type: object
      properties:
        id:
          type: integer
        date:
          type: string
          format: "date-time"
        link:
          type: string
          format: uri
        title:
          type: object
          properties:
            rendered:
              type: string
        excerpt:
          type: object
          properties:
            rendered:
              type: string
    WPPage:
      type: object
      properties:
        id:
          type: integer
        date:
          type: string
          format: "date-time"
        link:
          type: string
          format: uri
        title:
          type: object
          properties:
            rendered:
              type: string
    WPProduct:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        permalink:
          type: string
          format: uri
        price:
          type: string
        currency:
          type: string
        date_modified:
          type: string
          format: "date-time"
        stock_status:
          type: string
