Skip to content

Commit

Permalink
docs: remove getHeader from documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
42atomys committed Sep 15, 2024
1 parent 2fa53c4 commit e71b329
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ specs:
"config": "{{ toJson .Config }}",
"metadata": {
"specName": "{{ .Spec.Name }}",
"deliveryID": "{{ .Request.Header | getHeader "X-Delivery" | default "unknown" }}"
"deliveryID": "{{ .Request.Header.Get "X-Delivery" | default "unknown" }}"
},
"payload": {{ .Payload }}
}
Expand Down Expand Up @@ -113,7 +113,7 @@ specs:
formatting:
templateString: |
{
"deliveryID": "{{ .Request.Header | getHeader "X-Delivery" | default "unknown" }}"
"deliveryID": "{{ .Request.Header.Get "X-Delivery" | default "unknown" }}"
}
httpCode: 200
contentType: application/json
Expand Down
6 changes: 3 additions & 3 deletions tests/integrations/webhooked_config.integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ specs:
formatting:
templateString: |
{
"contentType": "{{ .Request.Header | getHeader "Content-Type" }}",
"contentType": "{{ .Request.Header.Get "Content-Type" }}",
"data": {{ .Payload }}
}
storage:
Expand All @@ -66,7 +66,7 @@ specs:
entrypointUrl: /integration/basic-response
response:
formatting:
templateString: '{{ fromJson .Payload | lookup "id" }}'
templateString: '{{ fromJson .Payload | dig "id" }}'
httpCode: 200
security:
- header:
Expand Down Expand Up @@ -139,4 +139,4 @@ specs:
# In which database do you want to store your data
database: 0
# The key where you want to send the data
key: integration:advanced-formatted-usage
key: integration:advanced-formatted-usage
8 changes: 4 additions & 4 deletions tests/loadtesting/webhooks.tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ specs:
"config": "{{ toJson .Config }}",
"storage": {{ toJson .Storage }},
"metadata": {
"model": "{{ .Request.Header | getHeader "X-Model" }}",
"event": "{{ .Request.Header | getHeader "X-Event" }}",
"deliveryID": "{{ .Request.Header | getHeader "X-Delivery" | default "unknown" }}"
"model": "{{ .Request.Header.Get "X-Model" }}",
"event": "{{ .Request.Header.Get "X-Event" }}",
"deliveryID": "{{ .Request.Header.Get "X-Delivery" | default "unknown" }}"
},
"payload": {{ .Payload }}
}
storage: []
storage: []
8 changes: 4 additions & 4 deletions tests/template.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"config": "{{ toJson .Config }}",
"storage": {{ toJson .Storage }},
"metadata": {
"model": "{{ .Request.Header | getHeader "X-Model" }}",
"event": "{{ .Request.Header | getHeader "X-Event" }}",
"deliveryID": "{{ .Request.Header | getHeader "X-Delivery" | default "unknown" }}"
"model": "{{ .Request.Header.Get "X-Model" }}",
"event": "{{ .Request.Header.Get "X-Event" }}",
"deliveryID": "{{ .Request.Header.Get "X-Delivery" | default "unknown" }}"
},
"payload": {{ .Payload }}
}
}
14 changes: 7 additions & 7 deletions tests/webhooks.tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ specs:
"config": "{{ toJson .Config }}",
"storage": {{ toJson .Storage }},
"metadata": {
"model": "{{ .Request.Header | getHeader "X-Model" }}",
"event": "{{ .Request.Header | getHeader "X-Event" }}",
"deliveryID": "{{ .Request.Header | getHeader "X-Delivery" | default "unknown" }}"
"model": "{{ .Request.Header.Get "X-Model" }}",
"event": "{{ .Request.Header.Get "X-Event" }}",
"deliveryID": "{{ .Request.Header.Get "X-Delivery" | default "unknown" }}"
},
"payload": {{ .Payload }}
}
Expand All @@ -46,7 +46,7 @@ specs:
storage: '{{ toJson .Storage }}'
metadata: |
{
"model": "{{ .Request.Header | getHeader "X-Model" }}",
"event": "{{ .Request.Header | getHeader "X-Event" }}",
"deliveryID": "{{ .Request.Header | getHeader "X-Delivery" | default "unknown" }}"
}
"model": "{{ .Request.Header.Get "X-Model" }}",
"event": "{{ .Request.Header.Get "X-Event" }}",
"deliveryID": "{{ .Request.Header.Get "X-Delivery" | default "unknown" }}"
}

0 comments on commit e71b329

Please sign in to comment.