You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[MutabilityWithReadOnly] Optimize to prevent excessive memory usage on large specs (#813)
* Initial plan
* Fix MutabilityWithReadOnly rule to avoid out of memory issue by filtering earlier
Co-authored-by: AkhilaIlla <36493984+AkhilaIlla@users.noreply.github.com>
* Remove redundant checks from mutability-with-read-only function
Co-authored-by: AkhilaIlla <36493984+AkhilaIlla@users.noreply.github.com>
* Add Array.isArray check for x-ms-mutability defensive programming
Co-authored-by: AkhilaIlla <36493984+AkhilaIlla@users.noreply.github.com>
* Move length check to given clause for maximum efficiency
Co-authored-by: AkhilaIlla <36493984+AkhilaIlla@users.noreply.github.com>
* Remove Array.isArray check that changed behavior - keep performance optimization only
Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com>
* Simplify to minimal change: only filter readOnly and x-ms-mutability in given clause
Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com>
* Add comprehensive tests for all readOnly and x-ms-mutability combinations
Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com>
* Add tests for properties with omitted readOnly or x-ms-mutability fields
Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com>
* Refactor tests to reduce redundancy using helper function and consolidated test cases
Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com>
* Change helper function type from any to unknown for better type safety
Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com>
* improve comment
* Add Rush change file for MutabilityWithReadOnly performance fix
Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com>
* Update package.json to 2.2.1 and add CHANGELOG entry
Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com>
* improve changelog
* Apply suggestion from @mikeharder
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AkhilaIlla <36493984+AkhilaIlla@users.noreply.github.com>
Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com>
Co-authored-by: Mike Harder <mharder@microsoft.com>
expect(results[0].message).toBe(`When property is modeled as "readOnly": true then x-ms-mutability extension can only have "read" value. When property is modeled as "readOnly": false then applying x-ms-mutability extension with only "read" value is not allowed. Extension contains invalid values: 'read'.`);
expect(results[1].message).toBe(`When property is modeled as "readOnly": true then x-ms-mutability extension can only have "read" value. When property is modeled as "readOnly": false then applying x-ms-mutability extension with only "read" value is not allowed. Extension contains invalid values: 'read, update'.`);
0 commit comments