Skip to content

CDA-142 - Switch FAIL_IF_EXISTS to OVERRIDE_PROTECTION for gate change post endpoint - #1992

Open
RyanM-RMA wants to merge 4 commits into
USACE:developfrom
RyanM-RMA:bugfix/CDA-142
Open

RyanM-RMA wants to merge 4 commits into
USACE:developfrom
RyanM-RMA:bugfix/CDA-142

Conversation

@RyanM-RMA

@RyanM-RMA RyanM-RMA commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Switched FAIL_IF_EXISTS to OVERRIDE_PROTECTION for gate change post endpoint. Updated unit tests

Related Issue

Closes #1906
Jira Ticket: https://jira.hecdev.net/browse/CDA-142

Validation

Verified with unit tests

Checklist

  • AI tools used

@read-the-docs-community

read-the-docs-community Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 CWMS-Data-APi | 🛠️ Build #34980944 | 📁 Comparing d2d8db2 against latest (61f31be)

  🔍 Preview build  

No files changed.

@RyanM-RMA RyanM-RMA changed the title Switch FAIL_IF_EXISTS to OVERRIDE_PROTECTION for gate change post endpoint CDA-142 - Switch FAIL_IF_EXISTS to OVERRIDE_PROTECTION for gate change post endpoint Oct 5, 2026
required = true),
queryParams = {
@OpenApiParam(name = OVERRIDE_PROTECTION, type = Boolean.class,
description = "Create will fail if provided Gate Changes already exist." +

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description has not been changed, look at override protection annotations from other controllers for reference.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the description to be in alignment with other OVERRIDE_PROTECTION descriptions. Also updated FAIL_IF_EXISTS description.

" Default: true"),
@OpenApiParam(name = FAIL_IF_EXISTS, type = Boolean.class,
description = "Create will fail if provided Gate Changes already exist. Default: true")
description = "Create will fail if provided Gate Changes already exist." +

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a deprecated boolean that should be set for this OpenApiParam annotation

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the deprecated flag for FAIL_IF_EXISTS

.body(json)
.header(AUTH_HEADER, USER.toHeaderValue())
.queryParam(FAIL_IF_EXISTS, "false")
.queryParam(OVERRIDE_PROTECTION, "false")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps include a test to verify the old query parameter can still be used for the time being

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: The gate change endpoint for POST uses fail-if-exists for override protection

2 participants