Skip to content

Swagger docs do not show seasonal location level POST payloads #1723

@krowvin

Description

@krowvin

Problem

The Swagger docs at /cwms-data/swagger-docs document the location level POST body as the base LocationLevel shape which makes it look like clients can only submit fields such as constant-value and cannot store seasonal location levels.

The API currently supports seasonal level writes when the body contains seasonal-values. In LevelsController.deserializeLocationLevel, CDA dispatches to SeasonalLocationLevel when seasonal-values is present, and the DAO stores those values through the normal location level store path.

Why this matters

A user trying to store a seasonal level from Swagger has no discoverable request example or schema for fields such as:

  • seasonal-values
  • interval-origin
  • interval-months
  • interval-minutes
  • interpolate-string
  • per-seasonal-value value, offset-months, and offset-minutes

This is especially confusing because the same endpoint accepts different mutually exclusive POST variants. A caller may only want to store a constant-value, while another caller may need seasonal-values, a seasonal-time-series-id, or a virtual level body.

Suggested improvement

May need to update javalin to support this?

Expose the alternate POST request body shapes in Swagger/OpenAPI so the endpoint documents the supported variants instead of only the base DTO. Ideally the request body would show separate examples/schemas for:

  • constant location level (constant-value)
  • seasonal location level (seasonal-values)
  • time-series-backed seasonal location level (seasonal-time-series-id)
  • virtual location level

Notes

SeasonalLocationLevel requires office-id, location-level-id, level-date, and seasonal-values. interval- months and interval-minutes are mutually exclusive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions