v2.2.1
Patch Changes
-
304cbfe: Add
example(name)method to response builder for selecting named OpenAPI examplesDevelopers can now select a specific named example from the OpenAPI specification using the strongly-typed
example()method on a response builder:return $.response[200].example("namedExample1");
The method is fully type-safe: TypeScript will autocomplete the example names defined in the OpenAPI document and report a type error if an unknown name is used.
Example names are collected from the
examplesfield of each media type in the response content (OpenAPI 3.x). The method can be chained with other response builder methods:return $.response[200] .example("namedExample1") .header("some-header", "some-value");