-
Notifications
You must be signed in to change notification settings - Fork 2
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
DMP-4366: Add and adjust admin portal API validations #2409
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be tests to show the endpoints fail if the size of whats constrained fails?
We could create dedicated tests to confirm the constrains are hit successfully, however this seems redundant as we use a third party library to manage all of this for us as such as long as the swagger is accurate the validation should work as the library would have there own tests to verify all the validation is applied correctly |
@Ben-Edwards-cgi just discussing with Karen, do you not want an integration test(s) to make sure the application behaves as expected when one of these limits is exceeded? |
@jackmaloney As this is an ingres point for the application rather then an endpoint we consume, our application does not care about the response, we would just chuck a 400 for the FE to handle in the same way we handle all other schema validation failures. So I don't think there is much if any additional value gained for adding additional tests for this. |
I don't think it's worth adding tests to test the swagger constraints, we have tests on the frontend to check the implementation there and the backend constraints are a fallback. As we are simply adding configuration, swagger should be behaving as specified. I know there's always a risk that it might not, but the risk here is tiny. |
Links
Change description
Summary of Git Diff
This Git diff outlines various updates made to multiple OpenAPI YAML files. The changes primarily involve the addition of
maxLength
,minimum
, andmaximum
constraints for several fields across different components, enhancing the validation of input data.Highlights
audio.yaml:
maxLength: 64
tocourtroom_name
.audiorequests.yaml:
minimum: 1
andmaximum: 2147483647
tomedia_request_id
.maxLength: 32
tocase_number
.maxLength: 2000
toowner
andrequested_by
.cases.yaml:
maxLength: 64
tocourtroom_name
.courthouse.yaml:
maxLength: 255
tocourthouse_name
in two locations.event.yaml:
maxLength: 64
tocourtroom_name
.hearings.yaml:
maxLength: 64
tocourtroom_name
.transcriptions.yaml:
minimum: 1
andmaximum: 2147483647
totranscription_id
.maxLength: 32
tocase_number
.maxLength: 2000
toowner
andrequested_by
in multiple sections.Does this PR introduce a breaking change? (check one with "x")