{"record":{"id":"5801705adc1ebb79","repo":"pathwaycom/pathway","slug":"raw-endpoint-input-format-requires-value-colum","errorCode":null,"errorMessage":"'raw' endpoint input format requires 'value' column in schema","messagePattern":"'raw' endpoint input format requires 'value' column in schema","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/http/_server.py","lineNumber":226,"sourceCode":"            endpoint_description[\"description\"] = self.description\n        if self.summary is not None:\n            endpoint_description[\"summary\"] = self.summary\n\n        return {method.lower(): endpoint_description}\n\n    def _is_method_exposed(self, method):\n        return self.method_types is None or method.upper() in self.method_types\n\n    def _add_optional_traits_if_present(self, field_description, props):\n        if props.example is not None:\n            field_description[\"example\"] = props.example\n        if props.description is not None:\n            field_description[\"description\"] = props.description\n\n    def _construct_openapi_plaintext_schema(self, schema) -> dict:\n        query_column = schema.columns().get(QUERY_SCHEMA_COLUMN)\n        if query_column is None:\n            raise ValueError(\n                \"'raw' endpoint input format requires 'value' column in schema\"\n            )\n        openapi_type = _ENGINE_TO_OPENAPI_TYPE.get(query_column, \"string\")\n        openapi_format = _ENGINE_TO_OPENAPI_FORMAT.get(query_column)\n        description = {\n            \"type\": openapi_type,\n        }\n        if openapi_format:\n            description[\"format\"] = openapi_format\n        if query_column.has_default_value():\n            description[\"default\"] = query_column.default_value\n        self._add_optional_traits_if_present(description, query_column)\n\n        return description\n\n    def _construct_openapi_get_request_schema(self, schema) -> list:\n        parameters = []\n        for name, props in schema.columns().items():","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/http/_server.py#L208-L244","documentation":"Raised by pw.io.http.rest_connector when the endpoint runs in 'raw' input format but the schema has no column named 'query' (QUERY_SCHEMA_COLUMN = 'query'). In raw mode Pathway reads the plain request body into a single column, which must be called 'query'; the OpenAPI plaintext schema generator then needs that column to describe the endpoint. The error message saying 'value' column is misleading — the code actually looks up the 'query' column.","triggerScenarios":"Calling pw.io.http.rest_connector(...) with schema=None triggers the built-in raw schema pw.schema_builder({'query': ...}), so this error normally does not fire from that path. It fires when a custom schema lacking a 'query' column is combined with raw-format handling, e.g. via the internal RestServerSubject with format='raw', or when a schema passed to the connector defines columns like 'value' or 'data' instead of 'query'.","commonSituations":"Developers porting older REST connector code that used a 'value' column name; constructing a schema with pw.schema_builder({'value': pw.column_definition()}) and expecting raw body ingestion; calling lower-level internals with a custom schema but defaulting to raw format.","solutions":["If you want raw body ingestion, pass schema=None and let rest_connector build the default 'query' column.","If you supply a custom schema, make sure it contains a column literally named 'query' when raw format is used: pw.schema_builder({'query': pw.column_definition(dtype=str)}).","For structured JSON payloads, use a full custom schema with typed columns (format switches to 'custom' automatically when schema is given to rest_connector)."],"exampleFix":"# before\nschema = pw.schema_builder({\"value\": pw.column_definition()})\n# after\nschema = pw.schema_builder({\"query\": pw.column_definition()})  # or simply schema=None","handlingStrategy":"validation","validationCode":"from pathway import io as pio\n\ndef has_query_column(schema) -> bool:\n    return \"query\" in schema.columns()","typeGuard":"def is_raw_ready_schema(schema) -> bool:\n    cols = schema.columns()\n    return cols is not None and \"query\" in cols","tryCatchPattern":null,"preventionTips":["For raw body ingestion pass schema=None instead of hand-building one.","If you build a raw-mode schema yourself, always name the single column 'query'.","Add a unit test asserting 'query' in schema.columns() before connector setup."],"tags":["http","rest-connector","schema","pathway"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}