Skip to content

Conversation

@MathiasSpanhove
Copy link
Contributor

@MathiasSpanhove MathiasSpanhove commented Oct 28, 2022

Description

It was not possible to pass a required validation of a request body field which has a default value after clicking the Reset button.
Behind the scenes everything was being reset to 'null' values. This fix should resolve this issue by using the default request body values instead.

Motivation and Context

Fixes #8217

How Has This Been Tested?

Manually tested, please guide me on how I can test this if needed/possible.
I did not find a related test and I'm not sure how to test this using e2e.

Screenshots (if appropriate):

See Issue #8217

Checklist

My PR contains...

  • No code changes (src/ is unmodified: changes to documentation, CI, metadata, etc.)
  • Dependency changes (any modification to dependencies in package.json)
  • Bug fixes (non-breaking change which fixes an issue)
  • Improvements (misc. changes to existing features)
  • Features (non-breaking change which adds functionality)

My changes...

  • are breaking changes to a public API (config options, System API, major UI change, etc).
  • are breaking changes to a private API (Redux, component props, utility functions, etc.).
  • are breaking changes to a developer API (npm script behavior changes, new dev system dependencies, etc).
  • are not breaking changes. (Not sure about this one)

Documentation

  • My changes do not require a change to the project documentation.
  • My changes require a change to the project documentation.
  • If yes to above: I have updated the documentation accordingly.

Automated tests

  • My changes can not or do not need to be tested.
  • My changes can and should be tested by unit and/or integration tests.
  • If yes to above: I have added tests to cover my changes.
  • If yes to above: I have taken care to cover edge cases in my tests.
  • All new and existing tests passed.

@tim-lai
Copy link
Contributor

tim-lai commented Nov 7, 2022

@MathiasSpanhove Thanks for the PR! I think the easiest path for testing is a Cypress test. E.g. in the original issue, assert that the field value is what it should be instead of "default".

Copy link
Contributor

@tim-lai tim-lai left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Just some reorganizing changes requested.

@MathiasSpanhove
Copy link
Contributor Author

@MathiasSpanhove Thanks for the PR! I think the easiest path for testing is a Cypress test. E.g. in the original issue, assert that the field value is what it should be instead of "default".

I've added a Cypress test to the PR

@tim-lai tim-lai merged commit ffe24d5 into swagger-api:master Nov 8, 2022
@tim-lai
Copy link
Contributor

tim-lai commented Nov 8, 2022

@MathiasSpanhove PR merged! Thanks for the contribution and iteration!

@MathiasSpanhove MathiasSpanhove deleted the fix/8217-reset-request-body-not-using-defaults branch November 8, 2022 23:43
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.

Cannot pass the required validation of the field which has default value after the Reset button pushed

2 participants