Skip to content

feat: Validate request option in Mock mode #2695

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

Open
7 tasks
thim81 opened this issue Apr 22, 2025 · 1 comment
Open
7 tasks

feat: Validate request option in Mock mode #2695

thim81 opened this issue Apr 22, 2025 · 1 comment

Comments

@thim81
Copy link

thim81 commented Apr 22, 2025

User Story Description

As a Prism user,

I want to be able to define the option to bypass the request validation and just return the mocked response,

so I can showcase a response even when then the request is invalid, which is usefull for a demo mode.

Now, it seems that it is not possible circumvent the request validation, it is always triggered.
Returning validation errors instead of the response.

example:
[5:34:12 PM] › [VALIDATOR] ✖ error Violation: request.body Request body must have required property 'ticketDate'

Response

{
    "type": "object",
    "title": "Validation failed"
}

The same logic that would apply for the Proxy CLI --validate-request

Acceptance Criteria

  • Have the option to toggle the request validation off/on
  • When the request validation is off, the response is returned, even with invalid input

Sprint Ready Checklist

  • Acceptance criteria defined
  • Team understands acceptance criteria
  • Team has defined solution / steps to satisfy acceptance criteria
  • Acceptance criteria is verifiable / testable
  • External / 3rd Party dependencies identified
@thim81 thim81 changed the title feat: Bypass request validation in Mock mode feat: Validate request option in Mock mode Apr 22, 2025
@thim81
Copy link
Author

thim81 commented Apr 22, 2025

hi @SergioV85

I created a #2696 to introduce the option for the Mock mode of Prism.
Let me know if you have comments are remarks, to improve the feature.

If you don't think it is a useful addition, let me know, so I can close the PR.

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

No branches or pull requests

1 participant