< Summary - Kestrun — Combined Coverage

Information
Class: Public.OpenAPI.New-KrOpenApiLink
Assembly: Kestrun.PowerShell.Public
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/OpenAPI/New-KrOpenApiLink.ps1
Tag: Kestrun/Kestrun@0d738bf294e6281b936d031e1979d928007495ff
Line coverage
0%
Covered lines: 0
Uncovered lines: 1
Coverable lines: 1
Total lines: 41
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 12/12/2025 - 17:27:19 Line coverage: 0% (0/1) Total lines: 41 Tag: Kestrun/Kestrun@826bf9dcf9db118c5de4c78a3259bce9549f0dcd

Metrics

File(s)

/home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/OpenAPI/New-KrOpenApiLink.ps1

#LineLine coverage
 1<#
 2.SYNOPSIS
 3    Creates a new OpenAPI Link object.
 4.DESCRIPTION
 5    This function creates a new OpenAPI Link object that can be used to define relationships between operations
 6    in an OpenAPI specification. Links allow you to specify how the output of one operation can be used as input to anot
 7.PARAMETER OperationRef
 8    A reference to an existing operation in the OpenAPI specification using a JSON Reference.
 9.PARAMETER OperationId
 10    The operationId of an existing operation in the OpenAPI specification.
 11.PARAMETER Description
 12    A description of the link.
 13.PARAMETER Server
 14    An OpenAPI Server object that specifies the server to be used for the linked operation.
 15.PARAMETER Parameters
 16    A hashtable mapping parameter names to runtime expressions or literal objects that define the parameters for the lin
 17.PARAMETER RequestBody
 18    A runtime expression or literal object that defines the request body for the linked operation.
 19.EXAMPLE
 20    $link = New-KrOpenApiLink -OperationId "getUser" -Description "Link to get user details" -Parameters @{ "userId" = "
 21    This example creates a new OpenAPI Link object that links to the "getUser" operation, with a description and paramet
 22.NOTES
 23    This function is part of the Kestrun PowerShell module for working with OpenAPI specifications.
 24#>
 25function New-KrOpenApiLink {
 26    [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')]
 27    [KestrunRuntimeApi('Definition')]
 28    param(
 29        [string]$OperationRef,
 30        [string]$OperationId,
 31        [string]$Description,
 32        # Accept a prebuilt OpenAPI server (use New-KrOpenApiServer)
 33        [Microsoft.OpenApi.OpenApiServer] $Server,
 34        # Accept hashtable name -> string (runtime expression) or literal object
 35        [hashtable]$Parameters,
 36        # Accept string runtime expression or hashtable/array literal object
 37        [object] $RequestBody
 38    )
 39
 040    return [Kestrun.OpenApi.OpenApiLinkFactory]::Create($OperationRef, $OperationId, $Description, $Server, $Parameters,
 41}

Methods/Properties

New-KrOpenApiLink()