Skip to content

Commit d65d0a7

Browse files
committed
Fix inconsistent header casing
1 parent adc9961 commit d65d0a7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/SDK/SDK.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ public function __construct(Language $language, Spec $spec)
103103
$this->twig->addFilter(new TwigFilter('caseUcfirst', function ($value) {
104104
return ucfirst($this->helperCamelCase($value));
105105
}));
106+
$this->twig->addFilter(new TwigFilter('caseUcwords', function ($value) {
107+
return ucwords($value, " -_");
108+
}));
106109
$this->twig->addFilter(new TwigFilter('caseLcfirst', function ($value) {
107110
return lcfirst((string)$value);
108111
}));

templates/http/docs/example.md.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{{ method.method | caseUpper }} {{spec.basePath}}{{ method.path }} HTTP/1.1
33
Host: {{ spec.host }}
44
{% for key, header in method.headers %}
5-
{{ key }}: {{ header }}{% if header == 'multipart/form-data' %}; boundary="{{boundary}}"{% endif ~%}
5+
{{ key | caseUcwords }}: {{ header }}{% if header == 'multipart/form-data' %}; boundary="{{boundary}}"{% endif ~%}
66
{% endfor %}
77
{% for key,header in spec.global.defaultHeaders %}
88
{{ key }}: {{ header }}

0 commit comments

Comments
 (0)