{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/unplain-io/json-schema/unplain-io-submit-result-schema.json",
  "title": "SubmitResult",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/unplain-io-openapi.json#/components/schemas/SubmitResult",
  "type": "object",
  "required": [
    "request",
    "duplicate"
  ],
  "properties": {
    "request": {
      "$ref": "#/$defs/FeatureRequest"
    },
    "duplicate": {
      "type": "boolean",
      "description": "True when an identical request already existed and the caller's vote was added to it instead."
    }
  },
  "$defs": {
    "FeatureRequest": {
      "type": "object",
      "required": [
        "id",
        "text",
        "status",
        "voteCount",
        "createdAt",
        "voted"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "text": {
          "type": "string",
          "maxLength": 200
        },
        "status": {
          "type": "string",
          "enum": [
            "requested",
            "planned",
            "building",
            "shipped"
          ],
          "description": "`declined` requests exist but are never returned publicly, so they cannot be resubmitted as new ideas."
        },
        "voteCount": {
          "type": "integer",
          "minimum": 0
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "voted": {
          "type": "boolean",
          "description": "Whether the calling browser has voted for this request."
        }
      }
    }
  }
}