Aller au contenu principal
CuteJSON
↑↓ Naviguer Enter Selectionner Esc Fermer

API E-commerce OpenAPI

Avance OpenAPI

Un document OpenAPI 3.1 pour une API e-commerce minimale avec produits et commandes. Un exemple realiste pour votre projet ou vos tests.

{
  "openapi": "3.1.0",
  "info": {
    "title": "Ecommerce API",
    "version": "2.0.0"
  },
  "paths": {
    "/products": {
      "get": {
        "summary": "List products",
        "responses": {
          "200": { "description": "Product list" }
        }
      }
    },
    "/orders": {
      "post": {
        "summary": "Place an order",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "productId": { "type": "string" },
                        "quantity": { "type": "integer" }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": { "description": "Order placed" }
        }
      }
    }
  }
}
Exemples JSON