@nldoc/openapi-test-set-generator
TypeScript icon, indicating that this package has built-in type declarations

1.3.77 • Public • Published

OpenAPI Test Set Generator

Why

The OpenAPI Test Set Generator helps create test scenarios from OpenAPI specifications by generating valid and invalid examples based on schema definitions.

How to use

Property Modifications

The generator supports modifying properties in example objects to create test scenarios. It can now handle both top-level and nested properties.

Nested Property Support

The generator automatically finds and modifies properties at any level of nesting based on the conditions specified in the where clause:

variantsOnExamples:
    property:
        # This will find and modify all string properties, including nested ones
        - where:
              type: 'string'
          do:
              set: 'modified value'
          valid: true

        # This will find and modify all object properties
        - where:
              type: 'object'
          do:
              set: null
          valid: false

        # This will find and modify all string properties with format "email",
        # even if they are nested deep in the object structure
        - where:
              type: 'string'
              format: 'email'
          do:
              set: 'modified@example.com'
          valid: true

The generator will recursively traverse the object structure to find and modify all properties that match the specified conditions, regardless of how deeply they are nested.

License

See LICENSE.txt.

Readme

Keywords

none

Package Sidebar

Install

npm i @nldoc/openapi-test-set-generator

Weekly Downloads

364

Version

1.3.77

License

EUPL-1.2

Unpacked Size

88.5 kB

Total Files

109

Last publish

Collaborators

  • stephanmeijer
  • dthoek
  • rawodo