openapi: "3.1.0"
info:
  title: "News & Publishing API"
  version: "1.0.0"
  description: "Articles, categories, authors, and editorial workflows Exported as an OpenAPI 3.1 document from Fake API for Devs."
servers:
  - url: "https://fakeapifordevs.vercel.app"
        description: "Fake API for Devs production endpoint"
tags:
  - name: "News & Publishing"
        description: "Articles, categories, authors, and editorial workflows"
paths:
  /api/news/articles:
    get:
      tags:
        - "News & Publishing"
      summary: "GET /api/news/articles?limit=5"
      operationId: "news_get_news_articles"
      parameters:
        - name: "page"
                    in: "query"
                    schema:
                      type: "integer"
                      minimum: 1
                      default: 1
                    description: "1-indexed page number for collection endpoints."
        - name: "per_page"
                    in: "query"
                    schema:
                      type: "integer"
                      minimum: 1
                      maximum: 50
                      default: 10
                    description: "Page size for collection endpoints."
        - name: "q"
                    in: "query"
                    schema:
                      type: "string"
                    description: "Optional text search filter where supported."
        - name: "delay"
                    in: "query"
                    schema:
                      type: "number"
                      minimum: 0
                      maximum: 10
                    description: "Optional artificial delay in seconds."
        - name: "simulate_error"
                    in: "query"
                    schema:
                      type: "string"
                      enum:
                        - "rate_limit"
                        - "server_error"
                        - "not_found"
                        - "unauthorized"
                        - "forbidden"
                        - "bad_request"
                        - "service_unavailable"
                        - "timeout"
                        - "malformed"
                    description: "Force a mock failure scenario for resilience testing."
      responses:
        200:
          description: "Successful response"
          content:
            application/json:
              schema:
                type: "object"
        400:
          description: "Bad request"
        401:
          description: "Unauthorized"
        404:
          description: "Not found"
        429:
          description: "Rate limited"
        500:
          description: "Internal server error"
    post:
      tags:
        - "News & Publishing"
      summary: "POST /api/news/articles"
      operationId: "news_post_news_articles"
      parameters:
        []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: "object"
            example:
              title: "Mock APIs unlock rapid prototyping"
              content: "Replace flaky backends with Fake API for Devs."
              category: "Technology"
              author: "api_editor"
              tags:
                - "developer-tools"
                - "mock-data"
      responses:
        200:
          description: "Successful response"
          content:
            application/json:
              schema:
                type: "object"
        400:
          description: "Bad request"
        401:
          description: "Unauthorized"
        404:
          description: "Not found"
        429:
          description: "Rate limited"
        500:
          description: "Internal server error"
  /api/news/categories:
    get:
      tags:
        - "News & Publishing"
      summary: "GET /api/news/categories"
      operationId: "news_get_news_categories"
      parameters:
        - name: "page"
                    in: "query"
                    schema:
                      type: "integer"
                      minimum: 1
                      default: 1
                    description: "1-indexed page number for collection endpoints."
        - name: "per_page"
                    in: "query"
                    schema:
                      type: "integer"
                      minimum: 1
                      maximum: 50
                      default: 10
                    description: "Page size for collection endpoints."
        - name: "q"
                    in: "query"
                    schema:
                      type: "string"
                    description: "Optional text search filter where supported."
        - name: "delay"
                    in: "query"
                    schema:
                      type: "number"
                      minimum: 0
                      maximum: 10
                    description: "Optional artificial delay in seconds."
        - name: "simulate_error"
                    in: "query"
                    schema:
                      type: "string"
                      enum:
                        - "rate_limit"
                        - "server_error"
                        - "not_found"
                        - "unauthorized"
                        - "forbidden"
                        - "bad_request"
                        - "service_unavailable"
                        - "timeout"
                        - "malformed"
                    description: "Force a mock failure scenario for resilience testing."
      responses:
        200:
          description: "Successful response"
          content:
            application/json:
              schema:
                type: "object"
        400:
          description: "Bad request"
        401:
          description: "Unauthorized"
        404:
          description: "Not found"
        429:
          description: "Rate limited"
        500:
          description: "Internal server error"