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

Update mock generator to allow disabling required check in schema renderer #295

Merged
merged 4 commits into from
May 24, 2024

Conversation

martinsirbe
Copy link
Contributor

@martinsirbe martinsirbe commented May 22, 2024

This pull request adds support to call the DisableRequiredCheck function on SchemaRenderer from the mock generator to allow rendering examples for all properties, regardless of their required status. This change is necessary to fix a bug in the Wiretap project, which currently causes only examples for required properties to be rendered in mock responses.

This change is crucial for fixing the Wiretap bug and ensuring accurate mock response data generation based on response examples declared in the OpenAPI specification.

Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.65%. Comparing base (711da3b) to head (8fd24ae).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #295   +/-   ##
=======================================
  Coverage   99.65%   99.65%           
=======================================
  Files         162      162           
  Lines       16101    16103    +2     
=======================================
+ Hits        16045    16047    +2     
  Misses         51       51           
  Partials        5        5           
Flag Coverage Δ
unittests 99.65% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@martinsirbe martinsirbe force-pushed the update-mock-gen branch 2 times, most recently from 2f18a5b to 62a8c1b Compare May 23, 2024 08:25
@martinsirbe martinsirbe changed the title Disable required check for schema rendering in the mock generator Update mock generator to allow disabling required check in schema renderer May 23, 2024
@martinsirbe martinsirbe force-pushed the update-mock-gen branch 3 times, most recently from ff5338e to 2a5e227 Compare May 23, 2024 08:42
Test default behaviour when required check is not disabled
Copy link
Member

@daveshanley daveshanley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thank you for your contribution.

@daveshanley daveshanley merged commit f27d57a into pb33f:main May 24, 2024
4 checks passed
@martinsirbe martinsirbe deleted the update-mock-gen branch May 26, 2024 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants