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

Regenerating (remove file and run rspec) the schema without changing the code, generates different file. #159

Closed
ipepe opened this issue Dec 13, 2023 · 1 comment · Fixed by #163
Labels
enhancement New feature or request

Comments

@ipepe
Copy link
Contributor

ipepe commented Dec 13, 2023

Regenerating (remove file and run rspec) the schema without changing the code, generates different file. I assume this is because RSpec is executing tests in different order each time and this causes schema to be generated differently. Would be nice to have some counter-measures for this like:

  • http status code keys are ordered in ascending manner
    • this should prevent code 400 and 500 to be in different order each time based on rspec randomization of order of tests
  • any schema keys are ordered alphabetically
    • this should prevent situations where payload is being extended by one or other test
@exoego exoego added the enhancement New feature or request label Dec 14, 2023
@exoego
Copy link
Owner

exoego commented Dec 14, 2023

This makes sense.
Keys should be ordered lexicographically to minimize diff on regenerating.
#155 implemented paths ordering, which should be generalized to other properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants