1

I have an endpoint which takes an X-Request-ID header. This is described as:

parameters:
    - in: header
      name: X-Request-ID
      schema:
        type: string
        format: uuid
      required: true

However, if I have ten endpoints that take this header, do I have to keep repeating this or is there anyway I can get some re-use?

Thanks

1

1 Answer 1

2

To add to Helen's comment, you can achieve some reuse by defining X-Request-ID as a Parameter Object in the Parameters Definitions Object, then reference it (by using a Reference Object) in the parameters field of each Path Item Object to denote that it's applicable to all operations under the path.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.