1 | initial version |
To include custom header parameters in request details when using Swagger, you need to add the header parameter to the "parameters" section of the Swagger specification.
Here's an example of how to define a custom header parameter in Swagger:
swagger: "2.0"
info:
title: My API
version: 1.0.0
paths:
/my-endpoint:
get:
summary: Get some data
parameters:
- name: my-custom-header
in: header
description: A custom header parameter
required: true
type: string
responses:
200:
description: OK
In this example, we're defining a custom header parameter called "my-custom-header". We specify that it's a header parameter by setting the "in" field to "header". We also set the "required" field to true to ensure that the header parameter is included in the request.
Once you've defined your custom header parameter in the Swagger specification, it should be included in the request details when you use Swagger to test your API.