{
  "openapi": "3.1.0",
  "info": {
    "title": "Drainage Services Department — DSD Facilities Self-Guided Tour",
    "version": "csdi-native-readonly-v1",
    "description": "Deterministic derivative of retained native CSDI metadata. Read-only GET operations are selected only where native capabilities and protocol documentation support them. Publisher originals remain separate. Successful metadata retrieval does not prove current data-query success, complete response fields or all layer combinations."
  },
  "paths": {
    "/server/rest/services/common/dsd_rcd_1728879302472_28930/FeatureServer/{layerId}/query": {
      "get": {
        "operationId": "ArcgisFeatureServerQueryFeatures",
        "tags": [
          "ArcGIS REST"
        ],
        "summary": "Query published features",
        "description": "Read-only GET query follows the source-advertised Query capability. One parameterized operation covers all queryable layers. Metadata field types are declared without inventing universally required attributes. Omitted f may produce the native REST default representation, which is not asserted as a JSON payload.",
        "parameters": [
          {
            "name": "layerId",
            "in": "path",
            "required": true,
            "description": "Published queryable layer or table. Values are publisher identifiers; examples are choices, not a closed enumeration. The full ID/title directory is in x-csdi-layer-choices.",
            "schema": {
              "type": "integer"
            },
            "examples": {
              "choice1": {
                "summary": "TourRoute",
                "value": 0
              },
              "choice2": {
                "summary": "TourStop",
                "value": 1
              }
            },
            "x-choice-count": 2
          },
          {
            "name": "f",
            "in": "query",
            "required": false,
            "description": "Advertised query representation. Supply this selector for the represented JSON/GeoJSON/PBF responses.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "geojson",
                "pbf"
              ]
            },
            "example": "json"
          },
          {
            "name": "where",
            "in": "query",
            "required": false,
            "description": "SQL WHERE expression over the published fields; source protocol supports this read-only query filter.",
            "schema": {
              "type": "string"
            },
            "example": "1=1"
          },
          {
            "name": "outFields",
            "in": "query",
            "required": false,
            "description": "Comma-separated source field names, or *. Field schemas are conditional on the selected layer and returned fields.",
            "schema": {
              "type": "string"
            },
            "example": "*"
          },
          {
            "name": "returnGeometry",
            "in": "query",
            "required": false,
            "description": "Whether native feature geometry should be included.",
            "schema": {
              "type": "boolean"
            },
            "example": false
          },
          {
            "name": "resultRecordCount",
            "in": "query",
            "required": false,
            "description": "Bound returned records where the selected layer advertises pagination; no global range is inferred.",
            "schema": {
              "type": "integer"
            },
            "example": 1,
            "x-supported-layer-ids": [
              0,
              1
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "Native publisher response; protocol or business errors may also be returned. Metadata connection and actual data-query success are separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArcgisFeatureServerArcgisJsonEnvelope"
                }
              },
              "application/geo+json": {
                "schema": {
                  "$ref": "#/components/schemas/ArcgisFeatureServerArcgisGeoJson"
                }
              },
              "application/x-protobuf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer/"
        },
        "servers": [
          {
            "url": "https://portal.csdi.gov.hk"
          }
        ],
        "x-native-source-evidence": [
          {
            "url": "https://portal.csdi.gov.hk/server/rest/services/common/dsd_rcd_1728879302472_28930/FeatureServer?f=pjson",
            "sha256": "52ce2882033dd05ff2d968e63d4c3206df3a462119c29dd0800f3d64ae315426",
            "httpStatus": 200,
            "contentType": "text/plain;charset=UTF-8",
            "role": "arcgis-service",
            "parseStatus": "pass",
            "kind": "arcgis-service"
          },
          {
            "url": "https://portal.csdi.gov.hk/server/rest/services/common/dsd_rcd_1728879302472_28930/FeatureServer/0?f=pjson",
            "sha256": "95adc2c5725a410be729627ec53ff5d016d7bf09daec81337f0451d862995e5b",
            "httpStatus": 200,
            "contentType": "text/plain;charset=UTF-8",
            "role": "arcgis-layer",
            "parseStatus": "pass",
            "kind": "arcgis-layer"
          },
          {
            "url": "https://portal.csdi.gov.hk/server/rest/services/common/dsd_rcd_1728879302472_28930/FeatureServer/1?f=pjson",
            "sha256": "33bf863515c78b323f426912013461ee98107b5a65f1ec11f36a1528bbe35b13",
            "httpStatus": 200,
            "contentType": "text/plain;charset=UTF-8",
            "role": "arcgis-layer",
            "parseStatus": "pass",
            "kind": "arcgis-layer"
          }
        ]
      }
    },
    "/server/services/common/dsd_rcd_1728879302472_28930/MapServer/WFSServer": {
      "get": {
        "operationId": "WfsMapServerGetFeature",
        "tags": [
          "WFS"
        ],
        "summary": "Retrieve published features",
        "description": "One read-only GET operation selects published feature types by name. Attribute types derive from retained DescribeFeatureType XSD when available; missing XSD, geometry, unread response data and unknown fields remain explicit limitations.",
        "parameters": [
          {
            "name": "service",
            "in": "query",
            "required": true,
            "description": "OGC service identifier.",
            "schema": {
              "type": "string",
              "enum": [
                "WFS"
              ]
            },
            "example": "WFS"
          },
          {
            "name": "version",
            "in": "query",
            "required": true,
            "description": "Exact capabilities version.",
            "schema": {
              "type": "string",
              "enum": [
                "2.0.0"
              ]
            },
            "example": "2.0.0"
          },
          {
            "name": "request",
            "in": "query",
            "required": true,
            "description": "Read-only operation advertised by GetCapabilities.",
            "schema": {
              "type": "string",
              "enum": [
                "GetFeature"
              ]
            },
            "example": "GetFeature"
          },
          {
            "name": "typeNames",
            "in": "query",
            "required": true,
            "description": "Published feature type names; multiple selections follow the advertised protocol syntax. Values are publisher identifiers; examples are choices, not a closed enumeration. The full ID/title directory is in x-csdi-layer-choices.",
            "schema": {
              "type": "string"
            },
            "examples": {
              "choice1": {
                "summary": "TourStop",
                "value": "csdi:TourStop"
              },
              "choice2": {
                "summary": "TourRoute",
                "value": "csdi:TourRoute"
              }
            },
            "x-choice-count": 2
          },
          {
            "name": "outputFormat",
            "in": "query",
            "required": false,
            "description": "Advertised native representation; JSON, GML, CSV and images are kept distinct.",
            "schema": {
              "type": "string",
              "enum": [
                "GML32",
                "GML32+ZIP",
                "GML32+GZIP",
                "application/gml+xml; version=3.2",
                "GML3",
                "GML3+ZIP",
                "GML3+GZIP",
                "text/xml; subtype=gml/3.1.1",
                "GML2",
                "GML2+ZIP",
                "GML2+GZIP",
                "text/xml; subtype=gml/2.1.2",
                "GEOJSON",
                "GEOJSON+ZIP",
                "GEOJSON+GZIP",
                "ESRIGEOJSON",
                "ESRIGEOJSON+ZIP",
                "ESRIGEOJSON+GZIP",
                "KML",
                "application/vnd.google-earth.kml xml",
                "application/vnd.google-earth.kml+xml",
                "KMZ",
                "application/vnd.google-earth.kmz",
                "SHAPE+ZIP",
                "CSV",
                "CSV+ZIP",
                "CSV+GZIP",
                "Geopackage",
                "Geopackage+ZIP"
              ]
            },
            "example": "GEOJSON"
          },
          {
            "name": "count",
            "in": "query",
            "required": false,
            "description": "OGC bounded feature limit; example requests one feature without claiming a server-wide bound.",
            "schema": {
              "type": "integer"
            },
            "example": 1
          },
          {
            "name": "srsName",
            "in": "query",
            "required": false,
            "description": "Output CRS choices advertised by at least one feature type; support may vary by selected type.",
            "schema": {
              "type": "string"
            },
            "example": "urn:ogc:def:crs:EPSG::2326"
          }
        ],
        "responses": {
          "200": {
            "description": "Native publisher response; protocol or business errors may also be returned. Metadata connection and actual data-query success are separate.",
            "content": {
              "application/gml+xml": {
                "schema": {
                  "type": "string"
                }
              },
              "text/xml": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WfsMapServerWfsFeatureCollection"
                }
              },
              "application/geo+json": {
                "schema": {
                  "$ref": "#/components/schemas/WfsMapServerWfsFeatureCollection"
                }
              },
              "application/vnd.google-earth.kml+xml": {
                "schema": {
                  "type": "string"
                }
              },
              "*/*": {
                "schema": {
                  "description": "Native Geopackage+ZIP output; wire media type/fields are not constrained."
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string",
                  "description": "Native CSV; row/column wire conformance is not inferred from JSON schemas."
                }
              }
            }
          }
        },
        "externalDocs": {
          "url": "https://docs.ogc.org/is/09-025r2/09-025r2.html"
        },
        "x-advertised-crss": [
          "urn:ogc:def:crs:EPSG::2326"
        ],
        "servers": [
          {
            "url": "https://portal.csdi.gov.hk"
          }
        ],
        "x-native-source-evidence": [
          {
            "url": "https://portal.csdi.gov.hk/server/services/common/dsd_rcd_1728879302472_28930/MapServer/WFSServer?service=wfs&request=GetCapabilities",
            "sha256": "0e38820907a5a2b99001590c6e84e1910a1e9e3f30c1842cc9bcd16fe96fab80",
            "httpStatus": 200,
            "contentType": "text/xml;charset=UTF-8",
            "role": "wfs-capabilities",
            "parseStatus": "pass",
            "kind": "wfs-capabilities"
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ArcgisFeatureServerArcgisLayer0Attributes": {
        "type": "object",
        "properties": {
          "DISTRICT_EN": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "DISTRICT_EN",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 12
          },
          "DISTRICT_SC": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "DISTRICT_SC",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 9
          },
          "DISTRICT_TC": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "DISTRICT_TC",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 9
          },
          "INTRO_EN": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "INTRO_EN",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1618
          },
          "INTRO_SC": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "INTRO_SC",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1039
          },
          "INTRO_TC": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "INTRO_TC",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1039
          },
          "LOCATION_EN": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "LOCATION_EN",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40
          },
          "LOCATION_SC": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "LOCATION_SC",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30
          },
          "LOCATION_TC": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "LOCATION_TC",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 30
          },
          "RECORD_ID": {
            "description": "Publisher field type: esriFieldTypeSmallInteger",
            "title": "RECORD_ID",
            "type": [
              "integer",
              "null"
            ]
          },
          "TOUR_EN": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "TOUR_EN",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 34
          },
          "TOUR_SC": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "TOUR_SC",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 24
          },
          "TOUR_TC": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "TOUR_TC",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 24
          },
          "OBJECTID": {
            "description": "Publisher field type: esriFieldTypeOID",
            "title": "OBJECTID",
            "type": "integer"
          },
          "Shape__Length": {
            "description": "Publisher field type: esriFieldTypeDouble",
            "title": "SHAPE_Length",
            "type": [
              "number",
              "null"
            ]
          },
          "Shape__Area": {
            "description": "Publisher field type: esriFieldTypeDouble",
            "title": "SHAPE_Area",
            "type": [
              "number",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "ArcgisFeatureServerArcgisLayer1Attributes": {
        "type": "object",
        "properties": {
          "EASTING": {
            "description": "Publisher field type: esriFieldTypeDouble",
            "title": "EASTING",
            "type": [
              "number",
              "null"
            ]
          },
          "NORTHING": {
            "description": "Publisher field type: esriFieldTypeDouble",
            "title": "NORTHING",
            "type": [
              "number",
              "null"
            ]
          },
          "DESC_EN": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "DESC_EN",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2432
          },
          "DESC_SC": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "DESC_SC",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2051
          },
          "DESC_TC": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "DESC_TC",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2051
          },
          "RECORD_ID": {
            "description": "Publisher field type: esriFieldTypeSmallInteger",
            "title": "RECORD_ID",
            "type": [
              "integer",
              "null"
            ]
          },
          "REMARK_EN": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "REMARK_EN",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 54
          },
          "REMARK_SC": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "REMARK_SC",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 21
          },
          "REMARK_TC": {
            "description": "Publisher field type: esriFieldTypeString",
            "title": "REMARK_TC",
            "type": [
              "string",
              "null"
            ],
            "maxLength": 21
          },
          "OBJECTID": {
            "description": "Publisher field type: esriFieldTypeOID",
            "title": "OBJECTID",
            "type": "integer"
          }
        },
        "additionalProperties": true
      },
      "ArcgisFeatureServerArcgisFeatureSet": {
        "type": "object",
        "properties": {
          "features": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "attributes": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ArcgisFeatureServerArcgisLayer0Attributes"
                    },
                    {
                      "$ref": "#/components/schemas/ArcgisFeatureServerArcgisLayer1Attributes"
                    }
                  ]
                },
                "geometry": {
                  "description": "Native geometry and spatial reference are not constrained by attribute metadata."
                }
              },
              "additionalProperties": true
            }
          },
          "exceededTransferLimit": {
            "type": "boolean"
          }
        },
        "additionalProperties": true
      },
      "ArcgisFeatureServerArcgisGeoJson": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "features": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "properties": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ArcgisFeatureServerArcgisLayer0Attributes"
                    },
                    {
                      "$ref": "#/components/schemas/ArcgisFeatureServerArcgisLayer1Attributes"
                    }
                  ]
                },
                "geometry": {
                  "description": "Geometry representation is not constrained by the retained attribute metadata."
                }
              },
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      },
      "ArcgisFeatureServerArcgisJsonEnvelope": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "features": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "attributes": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ArcgisFeatureServerArcgisLayer0Attributes"
                    },
                    {
                      "$ref": "#/components/schemas/ArcgisFeatureServerArcgisLayer1Attributes"
                    }
                  ]
                },
                "properties": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ArcgisFeatureServerArcgisLayer0Attributes"
                    },
                    {
                      "$ref": "#/components/schemas/ArcgisFeatureServerArcgisLayer1Attributes"
                    }
                  ]
                },
                "geometry": {
                  "description": "Geometry is not constrained by attribute metadata."
                }
              },
              "additionalProperties": true
            }
          },
          "exceededTransferLimit": {
            "type": "boolean"
          }
        },
        "additionalProperties": true
      },
      "WfsMapServerWfsFeatureCollection": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "features": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "properties": {
                  "description": "DescribeFeatureType attribute declarations unavailable; record fields remain unknown."
                },
                "geometry": {
                  "description": "Geometry representation is not constrained by the retained attribute metadata."
                }
              },
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": true
      }
    }
  },
  "externalDocs": {
    "url": "https://portal.csdi.gov.hk/csdi-webpage/doc/GeoSpatialServices"
  },
  "x-csdi-layer-choices": [
    {
      "id": 0,
      "title": "TourRoute",
      "protocol": "arcgis"
    },
    {
      "id": 1,
      "title": "TourStop",
      "protocol": "arcgis"
    },
    {
      "id": "csdi:TourStop",
      "title": "TourStop",
      "protocol": "wfs"
    },
    {
      "id": "csdi:TourRoute",
      "title": "TourRoute",
      "protocol": "wfs"
    }
  ],
  "x-csdi-source-evidence": [
    {
      "url": "https://portal.csdi.gov.hk/geoportal/csw?service=CSW&version=2.0.2&request=GetRecordById&elementSetName=full&id=dsd_rcd_1728879302472_28930",
      "sha256": "7fd790f8dd194249848e092325d418dc4cb976cac850f19a380871d688c01a3a",
      "httpStatus": 200,
      "contentType": "application/xml;charset=UTF-8",
      "role": "csw-record",
      "parseStatus": "pass",
      "kind": "csw-record"
    },
    {
      "url": "https://portal.csdi.gov.hk/server/rest/services/common/dsd_rcd_1728879302472_28930/FeatureServer?f=pjson",
      "sha256": "52ce2882033dd05ff2d968e63d4c3206df3a462119c29dd0800f3d64ae315426",
      "httpStatus": 200,
      "contentType": "text/plain;charset=UTF-8",
      "role": "arcgis-service",
      "parseStatus": "pass",
      "kind": "arcgis-service"
    },
    {
      "url": "https://portal.csdi.gov.hk/server/rest/services/common/dsd_rcd_1728879302472_28930/FeatureServer/0?f=pjson",
      "sha256": "95adc2c5725a410be729627ec53ff5d016d7bf09daec81337f0451d862995e5b",
      "httpStatus": 200,
      "contentType": "text/plain;charset=UTF-8",
      "role": "arcgis-layer",
      "parseStatus": "pass",
      "kind": "arcgis-layer"
    },
    {
      "url": "https://portal.csdi.gov.hk/server/rest/services/common/dsd_rcd_1728879302472_28930/FeatureServer/1?f=pjson",
      "sha256": "33bf863515c78b323f426912013461ee98107b5a65f1ec11f36a1528bbe35b13",
      "httpStatus": 200,
      "contentType": "text/plain;charset=UTF-8",
      "role": "arcgis-layer",
      "parseStatus": "pass",
      "kind": "arcgis-layer"
    },
    {
      "url": "https://portal.csdi.gov.hk/server/services/common/dsd_rcd_1728879302472_28930/MapServer/WFSServer?service=wfs&request=GetCapabilities",
      "sha256": "0e38820907a5a2b99001590c6e84e1910a1e9e3f30c1842cc9bcd16fe96fab80",
      "httpStatus": 200,
      "contentType": "text/xml;charset=UTF-8",
      "role": "wfs-capabilities",
      "parseStatus": "pass",
      "kind": "wfs-capabilities"
    }
  ],
  "x-csdi-source-scope": {
    "partialProtocols": [
      {
        "serviceId": "csdi-service-074f2e91750b7ef28168ce22",
        "code": "discovery_metadata_error",
        "reason": "No retained response; cache-only mode performs no HTTP request",
        "url": "https://portal.csdi.gov.hk/server/services/common/dsd_rcd_1728879302472_28930/MapServer/WFSServer?service=wfs&version=2.0.0&request=DescribeFeatureType"
      },
      {
        "code": "metadata_http_not_200",
        "url": "https://portal.csdi.gov.hk/server/services/common/dsd_rcd_1728879302472_28930/MapServer/WMSServer?service=WMS&request=GetCapabilities",
        "httpStatus": 403
      },
      {
        "serviceId": "csdi-service-c8a7d8cb4bf48376127f26cc",
        "code": "discovery_metadata_error",
        "reason": "Metadata request status http_error",
        "url": "https://portal.csdi.gov.hk/server/services/common/dsd_rcd_1728879302472_28930/MapServer/WMSServer?service=WMS&request=GetCapabilities"
      },
      {
        "serviceId": "csdi-service-c8a7d8cb4bf48376127f26cc",
        "protocol": "wms",
        "code": "unsupported_or_incomplete_native_contract",
        "reason": "No retained parseable WMS GetCapabilities"
      }
    ],
    "nativeMetadataStatus": {
      "status": "http_200_retained",
      "http200Sources": 5
    },
    "fullSourceCompleteness": "not_established",
    "actualDataQueriesByConversion": 0
  }
}
