Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add operation index to PathException for detailed error reporting #68

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

MuhammadJaziraly
Copy link
Contributor

The reason for this change is to have the index for the operation in cases where two identical operations target the same resource.

For example, if two identical remove operations target the same resource, the latter will fail because the first operation already removed the resource.

By having the index, we can accurately identify and report the failing operation.

@vearutop
Copy link
Member

vearutop commented Jul 2, 2024

Let's add op index via a setter function instead of constructor, so that there is no breaking change of constructor signature.

Enhanced the `PathException` exception class to include an operation index, identifying the specific operation that caused the exception.
Modified the `JsonPatch` class to pass this additional parameter when throwing the `PathException`.
Updated the corresponding tests to reflect these changes.
@MuhammadJaziraly
Copy link
Contributor Author

Done ✅

@vearutop vearutop merged commit c55d38a into swaggest:master Jul 2, 2024
12 checks passed
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.

2 participants