Custom Response Headers #1169
Answered
by
lbroudoux
goll-michael
asked this question in
Q&A
-
Dear Community, is there a way to define your own response headers in the operations? Example: We would like to incorporate Api-Deprecations and communicate this in the Microcks contracts. For this purpose, a header “X-api-deprecation” with the value “true” should be returned. Thanks in advance! Best regards |
Beta Was this translation helpful? Give feedback.
Answered by
lbroudoux
May 17, 2024
Replies: 1 comment 1 reply
-
Hi @goll-michael, Yes you can! Just integrate response headers in your example within your artifact. For example, if using an OpenAPI spec, you can have: responses:
'200':
[...]
headers:
'X-api-deprecation':
schema:
type: boolean
examples:
example_1:
value: true
example_2:
value: false |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
goll-michael
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Hi @goll-michael,
Yes you can! Just integrate response headers in your example within your artifact. For example, if using an OpenAPI spec, you can have: