Skip to content

[Feature]:Allow Posting multiple stream locations in single request #1874

Description

@Theresa5683

Describe the bug

Is it the intent of the post stream-locations endpoint to allow multiple stream locations? I can only get one stream-location at a time to work.

Expected behavior

I thought that when I posted three stream-locations, that it would post all three. However, I can only do them individually. Not sure if I've got the formatting incorrect or if it just doesn't accept multiples.

To Reproduce

  1. Go to CDA test swagger, post streamLocations
  2. Select fail-if-exists=false
  3. Put more than one gage in the request body. This is what I used:
[
  {
    "stream-location-node": {
      "id": {
        "office-id": "SWT",
        "name": "DIEB"
      },
      "stream-node": {
        "stream-id": {
          "office-id": "SWT",
          "name": "Saline_R"
        },
        "station": 53,
        "station-units": "mi"
      }
    },
    "area-units": "mile2",
    "stage-units": "ft"
  },
  {
    "stream-location-node": {
      "id": {
        "office-id": "SWT",
        "name": "DIES"
      },
      "stream-node": {
        "stream-id": {
          "office-id": "SWT",
          "name": "Saline_R"
        },
        "station": 48,
        "station-units": "mi"
      }
    },
    "area-units": "mile2",
    "stage-units": "ft"
  },
  {
    "stream-location-node": {
      "id": {
        "office-id": "SWT",
        "name": "LOCK"
      },
      "stream-node": {
        "stream-id": {
          "office-id": "SWT",
          "name": "Saline_R"
        },
        "station": 31,
        "station-units": "mi"
      }
    },
    "area-units": "mile2",
    "stage-units": "ft"
  }
]

Priority

Medium

Logs/Incident Identifier

I got the 500 error "Formatting error:Could not deserialize"

Incident identifier is:
3002d44a-4f01-4adf-a9d8-0068d0146086

CURL Commands

curl -X 'POST' \
  'https://cwms-data-test.cwbi.us/cwms-data/stream-locations?fail-if-exists=false' \
  -H 'accept: */*' \
  -H 'Authorization: REDACTED \
  -H 'Content-Type: application/json;version=1' \
  -H 'Cache-Control: no-cache, no-store, max-age=0' \
  -H 'Pragma: no-cache' \
  -d '[
  {
    "stream-location-node": {
      "id": {
        "office-id": "SWT",
        "name": "DIEB"
      },
      "stream-node": {
        "stream-id": {
          "office-id": "SWT",
          "name": "Saline_R"
        },
        "station": 53,
        "station-units": "mi"
      }
    },
    "area-units": "mile2",
    "stage-units": "ft"
  },
  {
    "stream-location-node": {
      "id": {
        "office-id": "SWT",
        "name": "DIES"
      },
      "stream-node": {
        "stream-id": {
          "office-id": "SWT",
          "name": "Saline_R"
        },
        "station": 48,
        "station-units": "mi"
      }
    },
    "area-units": "mile2",
    "stage-units": "ft"
  },
  {
    "stream-location-node": {
      "id": {
        "office-id": "SWT",
        "name": "LOCK"
      },
      "stream-node": {
        "stream-id": {
          "office-id": "SWT",
          "name": "Saline_R"
        },
        "station": 31,
        "station-units": "mi"
      }
    },
    "area-units": "mile2",
    "stage-units": "ft"
  }
]'

CDA Version

2026.05.12-testf OAS 3.0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status
    Todo
    Status
    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions