Commit Graph

4 Commits

Author SHA1 Message Date
Anton Averchenkov
f674f0ea32
Fix response structure validation tests for non-2xx responses (#19726) 2023-03-23 16:33:44 -04:00
Hamid Ghaf
e55c18ed12
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00
Anton Averchenkov
ce420de231
Ignore special HTTP fields in response validation tests (#19530) 2023-03-14 13:21:20 -04:00
Anton Averchenkov
6a2586747c
Add response schema validation methods & test helpers (#18635)
This pull request adds 3 functions (and corresponding tests):

`testhelpers/response_validation.go`:

  - `ValidateResponse`
  - `ValidateResponseData`
  
field_data.go:

  - `ValidateStrict` (has the "strict" validation logic)

The functions are primarily meant to be used in tests to ensure that the responses are consistent with the defined response schema. An example of how the functions can be used in tests can be found in #18636.

### Background

This PR is part of the ongoing work to add structured responses in Vault OpenAPI (VLT-234)
2023-01-13 14:55:56 -05:00