{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/watermelon-sh/json-schema/watermelon-sh-product-detail-schema.json",
  "title": "ProductDetail",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/studio-openapi.json#/components/schemas/ProductDetail",
  "allOf": [
    {
      "$ref": "#/$defs/Product"
    },
    {
      "type": "object",
      "properties": {
        "description": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Intro paragraphs."
        },
        "images": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          },
          "description": "Screenshot URLs."
        },
        "caseStudy": {
          "type": [
            "object",
            "null"
          ],
          "description": "The written case study: challenge, approach, features, outcome and testimonial. Sections are omitted when not published.",
          "properties": {
            "challenge": {
              "type": "object",
              "properties": {
                "intro": {
                  "type": "string",
                  "description": "The problem in one paragraph."
                },
                "points": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Specific questions or constraints."
                },
                "closing": {
                  "type": "string",
                  "description": "Closing framing of the problem."
                }
              }
            },
            "approach": {
              "type": "object",
              "properties": {
                "intro": {
                  "type": "string",
                  "description": "How the product was organised."
                },
                "steps": {
                  "type": "array",
                  "description": "The stages the product was structured around.",
                  "items": {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "description": "Stage name."
                      },
                      "description": {
                        "type": "string",
                        "description": "What happens in that stage."
                      }
                    }
                  }
                }
              }
            },
            "features": {
              "type": "array",
              "description": "What was built.",
              "items": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Feature name."
                  },
                  "description": {
                    "type": "string",
                    "description": "What the feature does."
                  }
                }
              }
            },
            "outcome": {
              "type": "object",
              "properties": {
                "intro": {
                  "type": "string",
                  "description": "Outcome summary."
                },
                "metrics": {
                  "type": "array",
                  "description": "Headline numbers.",
                  "items": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "string",
                        "description": "The number or figure."
                      },
                      "label": {
                        "type": "string",
                        "description": "What the figure measures."
                      }
                    }
                  }
                },
                "points": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "What the client was left with."
                }
              }
            },
            "testimonial": {
              "type": "object",
              "properties": {
                "quote": {
                  "type": "string",
                  "description": "Client quote."
                },
                "name": {
                  "type": "string",
                  "description": "Who said it."
                },
                "role": {
                  "type": "string",
                  "description": "Their role and company."
                }
              }
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "Product": {
      "type": "object",
      "description": "Summary of one case study.",
      "required": [
        "slug",
        "name",
        "type",
        "industry",
        "year",
        "stack",
        "services",
        "summary",
        "url"
      ],
      "properties": {
        "slug": {
          "type": "string",
          "description": "Identifier used in URLs."
        },
        "name": {
          "type": "string",
          "description": "Product name."
        },
        "type": {
          "type": "string",
          "description": "Kind of product, such as Dashboard or Mobile App."
        },
        "industry": {
          "type": "string",
          "description": "Industry the product serves."
        },
        "year": {
          "type": "string",
          "description": "Year of the engagement."
        },
        "client": {
          "type": "string",
          "description": "Client the product was built for."
        },
        "stage": {
          "type": "string",
          "description": "Product stage during the engagement, such as MVP or Production."
        },
        "engagement": {
          "type": "string",
          "description": "Length and shape of the engagement."
        },
        "results": {
          "type": [
            "string",
            "null"
          ],
          "description": "Headline outcome, when one is published."
        },
        "website": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Live product URL, when public."
        },
        "stack": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Technologies used."
        },
        "services": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Services Watermelon Studio provided."
        },
        "summary": {
          "type": "string",
          "description": "One-paragraph description of the product."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Case study page."
        },
        "markdownUrl": {
          "type": "string",
          "format": "uri",
          "description": "Markdown version of the case study page."
        }
      }
    }
  }
}