Skip to content

feat(ipa): Add IPA-111 validation rules - #1460

Draft
mongodb-sage-bot[bot] wants to merge 2 commits into
mainfrom
sage-bot/CLOUDP-439595/sage-CLOUDP-439595-1787849732487
Draft

feat(ipa): Add IPA-111 validation rules#1460
mongodb-sage-bot[bot] wants to merge 2 commits into
mainfrom
sage-bot/CLOUDP-439595/sage-CLOUDP-439595-1787849732487

Conversation

@mongodb-sage-bot

@mongodb-sage-bot mongodb-sage-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

Add three new Spectral validation rules enforcing lintable IPA-111 (Default Values) constraints to the IPA Validation Framework:

  • xgen-IPA-111-optional-fields-no-default: optional (non-required) fields must not define a default value. Boolean fields are delegated to the boolean rule below, and fields marked with the new x-xgen-server-computed-when-client-omitted extension are exempt.
  • xgen-IPA-111-effective-fields-read-only: effective-value fields (property names prefixed with effective) must be readOnly: true and must not appear in request schemas.
  • xgen-IPA-111-optional-boolean-fields-default-false: optional boolean fields must default to false.

Also adds the IPA-111.yaml ruleset, registers it in ipa-spectral.yaml, regenerates the ruleset README, and introduces shared helpers isRequiredProperty (schemaUtils) and hasServerComputedWhenClientOmittedExtension (extensions).

Jira ticket: CLOUDP-439595

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works

Changes to Spectral

  • I have read the README file for Spectral Updates

Important

MongoDB Contribution Guidelines

This pull request was generated by sage-bot on behalf of yeliz.henden@mongodb.com (ticket assignee). The assignee must self-review the changes before requesting review from another engineer.
The assignee is not allowed to merge their own PR without approval from another engineer.

## Proposed changes

Add three new Spectral validation rules enforcing lintable IPA-111 (Default Values) constraints to the IPA Validation Framework:

- `xgen-IPA-111-optional-fields-no-default`: optional (non-required) fields must not define a default value. Boolean fields are delegated to the boolean rule below, and fields marked with the new `x-xgen-server-computed-when-client-omitted` extension are exempt.
- `xgen-IPA-111-effective-fields-read-only`: effective-value fields (property names prefixed with `effective`) must be `readOnly: true` and must not appear in request schemas.
- `xgen-IPA-111-optional-boolean-fields-default-false`: optional boolean fields must default to `false`.

Also adds the `IPA-111.yaml` ruleset, registers it in `ipa-spectral.yaml`, regenerates the ruleset README, and introduces shared helpers `isRequiredProperty` (schemaUtils) and `hasServerComputedWhenClientOmittedExtension` (extensions).

_Jira ticket:_ CLOUDP-439595

## Checklist

- [ ] I have signed the [MongoDB CLA](https://www.mongodb.com/legal/contributor-agreement)
- [x] I have added tests that prove my fix is effective or that my feature works

### Changes to Spectral
- [x] I have read the [README](../tools/spectral/README.md) file for Spectral Updates
@mongodb-sage-bot

Copy link
Copy Markdown
Contributor Author

Sage Bot can help with this pull request. Just @sage-bot in comments and I'll start working on changes in this branch.
Learn more about Sage Bot

@mongodb-sage-bot

mongodb-sage-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

Sage Bot - Unexpected Error

Sage Bot ran into an unexpected error processing your request. If you need help, reach out in #ask-devprod.

@yelizhenden-mdb yelizhenden-mdb changed the title CLOUDP-439595: add IPA-111 validation rules feat(ipa): Add IPA-111 validation rules Aug 28, 2026
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.

1 participant