Skip to content

[F] HttpVisibilityProvider

HttpVisibilityProvider(verb)

function HttpVisibilityProvider(verb): VisibilityProvider

A visibility provider for HTTP operations. Pass this value as a provider to the getParameterVisibilityFilter and getReturnTypeVisibilityFilter functions in the TypeSpec core to get the applicable parameter and return type visibility filters for an HTTP operation.

When created with a verb, this provider will use the default visibility for that verb.

Parameters

ParameterTypeDescription
verbHttpVerbthe HTTP verb for the operation

Returns

VisibilityProvider

See

  • VisibilityProvider
  • getParameterVisibilityFilter
  • getReturnTypeVisibilityFilter

HttpVisibilityProvider(options)

function HttpVisibilityProvider(options): VisibilityProvider

A visibility provider for HTTP operations. Pass this value as a provider to the getParameterVisibilityFilter and getReturnTypeVisibilityFilter functions in the TypeSpec core to get the applicable parameter and return type visibility filters for an HTTP operation.

When created with an options object, this provider will use the verbSelector function to determine the verb for the operation and use the default visibility for that verb, or the configured HTTP verb for the operation, and finally the GET verb if the verbSelector function is not defined and no HTTP verb is configured.

Parameters

ParameterTypeDescription
optionsOperationParameterOptionsan options object with a verbSelector function that returns the HTTP verb for the operation

Returns

VisibilityProvider

See

  • VisibilityProvider
  • getParameterVisibilityFilter
  • getReturnTypeVisibilityFilter

HttpVisibilityProvider()

function HttpVisibilityProvider(): VisibilityProvider

A visibility provider for HTTP operations. Pass this value as a provider to the getParameterVisibilityFilter and getReturnTypeVisibilityFilter functions in the TypeSpec core to get the applicable parameter and return type visibility filters for an HTTP operation.

When created without any arguments, this provider will use the configured verb for the operation or the GET verb if no HTTP verb is configured and use the default visibility for that selected verb.

Returns

VisibilityProvider

See

  • VisibilityProvider
  • getParameterVisibilityFilter
  • getReturnTypeVisibilityFilter