Open jeluard opened 9 months ago
I don't follow exactly what problem is this trying to address, could you expand more on the motivation?
The high-level idea is to have comprehensive Test Cases that can be used with real chain data. e.g. right now there is no clear reproducible way to trigger specific errors reproducibly. The idea is similar to what can be found in execution-apis repository
Note that an alternative would be to have separate files defining individual Tests e.g. using markdown syntax
It is desirable to have a way to define valid Test Cases in the specification.
This would allow to:
The following is a proposed syntax allowing this. It builds on top of current usage of
example
in the specification while being light and OpenAPI compliant.Proposed syntax consist of:
x-test-cases
map propertyexamples
per component (parameters
,requestBody
andresponse
)The combination of
parameters
,requestBody
and associatedpath
properties form theRequest
. The result of the execution of this Request by a node must match the associatedResponse
definition.x-test-cases
is aMap[string, TestCase object]
(defined as an OpenAPI extension) allowing to list high-level details of all Test Cases perpath
, withTestCase object
defined as:description
a high-level description of theTestCase
expectedResponse
If a response is too big to be added inline, it can be defined as a URI via externalValue.
Here is an example:
Previous work
This proposition takes inspiration from the following works: