Options
All
  • Public
  • Public/Protected
  • All
Menu
     

Class GNDescr

A Parameter Description Documenter for GNParams or GNHeaders.

Hierarchy

  • GNDescr

Implements

Index

Constructors

constructor

  • A Parameter Description Documenter for GNParams or GNHeaders.

    Parameters

    Returns GNDescr

Properties

to

to: PTo

Denotes whether a GNParam is a path, header, or query/body parameter.

type

type: PType

A PType that the Param adheres to.

description

description: string

A description of what the Param entails.

required

required: boolean

Whether or not it is mandator to set this Param.

hidden

hidden: boolean

If true, this param is publicly. Good for Params that are set by the backend.

matches

matches: CLMatches

A plain-object that describes all the ways in which a GNParam is matched. This for params that takes a multitude of specific string-formats and dismiss any that do not conform.

Example

{
    matches: {
        "URL": "A valid URL-String (^https?://(?:\\b[\\w_-]\\b\\.)+[a-z]+(?:\\/[\\w%&=_-])\\/?$)",
        "IP": "A valid URL-String (^\\b((\\d|1\\d{1,2}|2([0-4]\\d|5[0-5]))(\\.|$)){4}\\b$)",
    }
}

Methods

Merge

  • Creates a new GNDescr version by merging the specified configs.

    Parameters

    • configs: Descr

      Config properties for the GNDescr object.

    Returns GNDescr

    A newly-merged GNDescr.

toCopy

  • Creates a deepcopy of this GNDescr instance.

    Returns GNDescr

    A clone of the GNDescr.

toDoc

  • A plain-object representation of this Description.

    Returns DocDescr

    An OpenAPI 3.0 formatted, plain-object version of a GNDescr.