openapi-to-hurl

NAME
SYNOPSIS
DESCRIPTION
OPTIONS

NAME

openapi-to-hurl - Generate hurl files from an Open API 3 specification

SYNOPSIS

openapi-to-hurl [-o|--out-dir] [-n|--validation] [-r|--header-vars] [-q|--query-params] [-i|--operation-id] [-t|--tag] [--variables-file-update] [--formatting] [--content-type] [-l|--log-level] [--quiet] [--error-handling] [--grouping] [-v|--version] [-h|--help] [INPUT]

DESCRIPTION

Generate hurl files from an Open API 3 specification

OPTIONS

-o, --out-dir=OUT_DIR

If the ’out-dir’ argument is provided the output will go to a series of directories and files instead of stdout. Note: if now ’out-dir’ is given, no variables file will be created

-n, --validation=VALIDATION [default: none]

This option indicates how the response should be validated

Possible values:

none: No validation

non-error-code: Validates the result is any status code less than 400

body: Validates the structure and types of the response body. Note: This tool will not produce response validation for union types (nullable, oneOf, not required, etc)

body-with-optionals: Validates the response body and treats all properties in the response body as if they are required

-r, --header-vars=HEADER_VARS

Variables will be added to the hurl variables file and the header of each request. Format: ’HEADER_KEY=HEADER_VALUE’

-q, --query-params=QUERY_PARAMS [default: required]

Choose whether, and how to, pass query params

Possible values:

none: No query params

required: Only the required query params

all: Sets a value for all query params

-i, --operation-id=OPERATION_ID

Generate only the operations identified with this options, e.g. ’openapi-to-hurl openapi.json -i getProducts -i createProduct’

-t, --tag=TAG

Generate only the operations under the given tags, e.g. ’openapi-to-hurl openapi.json -t orders -t products’. If used with the ’operation-id’ option the generated files will first be narrowed by tag then by operationId

--variables-file-update=VARIABLES_FILE_UPDATE [default: merge]

How the variables file should be updated

Possible values:

overwrite: Overwrites the entire variables file with new variables

merge: Merges new variables with old variables

--formatting=FORMATTING [default: request-bodies]

How the output should be formatted

Possible values:

no-formatting: Will not add any characters to the output that do not affect syntax

request-bodies: Will add some formatting to the request body

--content-type=CONTENT_TYPE [default: json]

Desired content type of the request. If the selected content type is not available in the schema or not supported by this tool the tool will select the first scpecified content type supported by this tool. If no valid content type is found the tool will use an empty request body

[possible values: text, json]

-l, --log-level=LOG_LEVEL [default: info]

Possible values:

error: The "error" level

warn: The "warn" level

info: The "info" level

debug: The "debug" level

trace: The "trace" level

--quiet

Set this to true to silence all logging

--error-handling=ERROR_HANDLING [default: terminate]

How to handle recoverable errors

Possible values:

log: Log the error to stderr but continue processing. Note that the program will still terminate if the error is unrecoverable, e.g. the input isn't a valid Open API Specification

terminate: Terminate the program on any errors found with the specification

--grouping=GROUPING [default: flat]

How the operations will be grouped into directories. Has no effect if no ’--out-dir’ argument is provided

Possible values:

flat: Flat grouping will group all operations together

path: Path grouping will group all operations by their uri path, with a directory per path

-v, --version
-h
, --help

Print help (see a summary with '-h')

[INPUT]

Input can be either a path to the specification or the result of stdin if used in a pipeline