Skip to content

v0.1.15

Latest
Compare
Choose a tag to compare
@daveshanley daveshanley released this 14 Jun 14:04

Currently when the response mock engine generates a response using the MockGenerator, the generated responses contain only examples for individual properties that are marked as required, see tests for more details.

The reason why generated responses contain only examples for required properties is a side-effect of using mock generator for validation. While it makes sense for validating required fields for requests, it shouldn't affect the response generation.

Changes:

  • By default, disables the required check on the response mock engine to ensure that all examples for individual properties are used in generated mock responses.
  • Introduces a new configuration option, enable-all-mock-response-fields, to allow only the use of required field examples in the generated mock responses when set to false.

This fix uses pb33f/libopenapi#295


Wiretap just blindly rewrites paths that match any configuration.

Some (poorly written) APIs don't necessarily want to rewrite everything under a specific resource location.

The current way to do this is to add a dummy path rewrite that takes precedence. This is kind of hacky and also doesn't jump over target rewriting.

Changelog

  • 3548ed6 Add tests for property examples usage in mock responses
  • 1357ba0 Added global and local ignore path rewriting support to path configurations.
  • 97a717c Disable required check on response mock engine
  • 0ac01b6 Make mock response field example usage configurable

@jacobm-splunk @martinsirbe