Resolves issue #1682, Remove redundant authority fields from Mongoose discriminator schemas (CNAOrg, SecretariatOrg, RootOrg) and verify behavior using a new integration test suite.#1816
Merged
Conversation
…at everything still works
cberger8
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes Issue #1682
Summary
This PR cleans up the Mongoose discriminator schemas (
cnaorg.js,secretariatorg.js, androotorg.js) by removing the redundantauthorityproperty. Because these models automatically inherit all schema properties from the parentBaseOrgschema, definingauthority: [String]redundantly was unnecessary.Note that the JSON AJV validation schemas under
schemas/registry-org/remain unchanged to continue enforcing strict payload validation (whereauthorityis indeed required/validated during POST and PUT requests). A new integration test suite has been introduced to verify inheritance behavior, persistence correctness, and API payload compatibility.Important Changes
src/model/cnaorg.jsauthority: [String]schema property.src/model/secretariatorg.jsauthority: [String]schema property.src/model/rootorg.jsauthority: [String]schema property.test/integration-tests/registry-org/registryOrgDiscriminatorAuthorityTest.jsauthorityis correctly stored in MongoDB and returned.Testing
Steps to manually test updated functionality, if possible
bash -i -c "npm run test:integration"and verify all 402 tests pass.bash -i -c "npm run test:unit-tests"and verify all 259 tests pass.Notes
/api/registryOrg/DELETE endpoint in test hooks to properly clean up created test records from MongoDB.