Set-KrOpenApiErrorSchema
SYNOPSIS
Sets the schema name used for autogenerated OpenAPI client-error responses.
SYNTAX
__AllParameterSets
Set-KrOpenApiErrorSchema [[-DocId] <string[]>] [-Name] <string> [[-ContentType] <string[]>]
[-WhatIf] [-Confirm] [<CommonParameters>]
ALIASES
This cmdlet has the following aliases, {{Insert list of aliases}}
DESCRIPTION
Configures the OpenAPI descriptor to use a custom schema component name for autogenerated client-error responses (for example 400, 406, 415, 422).
EXAMPLES
EXAMPLE 1
Set-KrOpenApiErrorSchema -Name ‘ApiError’
Uses ‘ApiError’ for autogenerated client-error response schemas in the default OpenAPI document.
EXAMPLE 2
Set-KrOpenApiErrorSchema -DocId @(‘Default’,’v2’) -Name ‘ApiError’
Uses ‘ApiError’ for both Default and v2 OpenAPI documents.
EXAMPLE 3
Set-KrOpenApiErrorSchema -Name ‘ApiError’ -ContentType @(‘application/json’,’application/problem+json’)
Uses ‘ApiError’ and emits autogenerated client-error responses for both JSON media types.
PARAMETERS
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-ContentType
One or more content types to use for autogenerated client-error responses. Defaults to application/problem+json.
Type: System.String[]
DefaultValue: '@([Kestrun.OpenApi.OpenApiDocDescriptor]::DefaultAutoErrorResponseContentType)'
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-DocId
One or more OpenAPI document IDs to configure. Defaults to the default document IDs.
Type: System.String[]
DefaultValue: '[Kestrun.OpenApi.OpenApiDocDescriptor]::DefaultDocumentationIds'
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Name
Schema component name to use for autogenerated client-error responses.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
NOTES
Set this before building/exporting OpenAPI output for predictable component naming.
RELATED LINKS
{{ Fill in the related links here }}