View Source OpenAPI.Processor.Ignore (OpenAPI Generator v0.2.0)

Ignore operations and schemas from the description

This module contains the default implementations for:

Configuration

All configuration for the functions in this module is contained in a key ignore of the active configuration profile. For example:

# config/config.exs

config :oapi_generator, default: [
  ignore: [
    "IgnoredOperation",
    ~r"/components/schemas/ignored-"
  ]
]

Each element of the ignored list is a pattern. Patterns are compared against the operation IDs and paths of an operation, and the paths and titles of a schema. If a string is given, it is compared for equality. Regular expressions are tested using Regex.match?/2.

If any pattern matches the tested operation or schema, it will be excluded.

Summary

Default Implementations

Ignore operations based on configured patterns of IDs and paths

Ignore schemas based on configured patterns of paths and titles

Types

Definition of a module to ignore

Default Implementations

Link to this function

ignore_operation?(state, operation)

View Source

Ignore operations based on configured patterns of IDs and paths

Default implementation of OpenAPI.Processor.ignore_operation?/2.

In this implementation, patterns from the ignore configuration key are compared against each operation ID and path. If a string pattern matches exactly, or regular expression pattern matches according to Regex.match?/2, the operation will be ignored.

Link to this function

ignore_schema?(state, schema)

View Source
@spec ignore_schema?(OpenAPI.Processor.State.t(), OpenAPI.Spec.Schema.t()) ::
  boolean()

Ignore schemas based on configured patterns of paths and titles

Default implementation of OpenAPI.Processor.ignore_schema?/2.

In this implementation, patterns from the ignore configuration key are compared against each schema title and path. If a string pattern matches exactly, or regular expression pattern matches according to Regex.match?/2, the schema will be ignored. This often means the type will be replaced by a plain map.

Types

@type definition() :: String.t() | Regex.t()

Definition of a module to ignore