{
  "openapi": "3.1.0",
  "info": {
    "title": "RSX Example Service",
    "version": "v1",
    "description": "Reference/template service — a widgets CRUD resource demonstrating every platform standard."
  },
  "servers": [
    {
      "url": "https://api.rsx.group"
    }
  ],
  "components": {
    "schemas": {
      "Widget": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "0198f2b1-6c2a-7c9e-9d3a-1e2f3a4b5c6d"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "example": "Acrylic Panel"
          },
          "quantity": {
            "type": "integer",
            "minimum": 0,
            "example": 12
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "example": "2026-07-12T14:30:00Z"
          }
        },
        "required": [
          "id",
          "name",
          "quantity",
          "createdAt"
        ]
      },
      "CreateWidget": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "example": "Acrylic Panel"
          },
          "quantity": {
            "type": "integer",
            "minimum": 0,
            "default": 0,
            "example": 12
          }
        },
        "required": [
          "name"
        ]
      },
      "UpdateWidget": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "quantity": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "id"
        ]
      },
      "RemoveWidget": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "id"
        ]
      }
    },
    "parameters": {}
  },
  "paths": {
    "/example/v1/widgets/add": {
      "post": {
        "operationId": "addWidget",
        "summary": "Create a widget",
        "tags": [
          "widgets"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWidget"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Widget created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Widget"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/example/v1/widgets/list": {
      "get": {
        "operationId": "listWidgets",
        "summary": "List widgets",
        "tags": [
          "widgets"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "example": ""
            },
            "required": false,
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "example": 20
            },
            "required": false,
            "name": "limit",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Widgets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Widget"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "cursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "cursor"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/example/v1/widgets/get": {
      "get": {
        "operationId": "getWidget",
        "summary": "Fetch one widget",
        "tags": [
          "widgets"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Widget",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Widget"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/example/v1/widgets/update": {
      "post": {
        "operationId": "updateWidget",
        "summary": "Update a widget",
        "tags": [
          "widgets"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWidget"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Widget updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Widget"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/example/v1/widgets/remove": {
      "post": {
        "operationId": "removeWidget",
        "summary": "Remove a widget",
        "tags": [
          "widgets"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RemoveWidget"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Widget removed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {}
}
