openapi: 3.0.0
info:
  title: FormatJSONOnline Cloudflare Worker API
  version: "1.0.0"
  description: >
    A fast serverless JSON processing API running on Cloudflare Workers.
    Supports formatting, validating, and minifying JSON payloads.

servers:
  - url: https://fjo-worker.anilpeter75.workers.dev

paths:
  /format:
    post:
      summary: Format and pretty-print JSON
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: string
      responses:
        "200":
          description: Formatted JSON output
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid:
                    type: boolean
                  formatted:
                    type: string
                  minified:
                    type: string
                  error:
                    type: string

  /validate:
    post:
      summary: Validate JSON syntax
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: string
      responses:
        "200":
          description: Validation result
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid:
                    type: boolean
                  error:
                    type: string

  /minify:
    post:
      summary: Minify JSON payload
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: string
      responses:
        "200":
          description: Minified JSON output
          content:
            application/json:
              schema:
                type: object
                properties:
                  minified:
                    type: string
                  error:
                    type: string
