Skip to content

Commit 8a313f8

Browse files
Merge pull request #14 from MacPaw/develop
Release
2 parents 0d6d843 + 42b4687 commit 8a313f8

3 files changed

Lines changed: 41 additions & 7 deletions

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 MacPaw Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,22 @@ public function index(BaggageSchemaResolver $schemaResolver)
6363
Decorate your http client in your service configuration:
6464
```yaml
6565
services:
66+
baggage_aware_payment_http_client:
67+
class: Macpaw\SchemaContextBundle\HttpClient\BaggageAwareHttpClient
68+
decorates: payment_http_client #http client to decorate
69+
arguments:
70+
- '@baggage_aware_payment_http_client.inner'
71+
```
72+
73+
### A Note on Testing
74+
75+
If you are replacing or mocking HTTP clients in your test environment, for example, using a library like [`macpaw/extended-mock-http-client`](https://github.com/MacPaw/extended_mock_http_client), you need to disable the `BaggageAwareHttpClient` decoration.
76+
77+
```yaml
78+
when@test:
79+
services:
6680
baggage_aware_payment_http_client:
6781
class: Macpaw\SchemaContextBundle\HttpClient\BaggageAwareHttpClient
68-
decorates: payment_http_client #http client to decorate
69-
arguments:
70-
- '@baggage_aware_payment_http_client.inner'
71-
- '@Macpaw\SchemaContextBundle\Service\BaggageSchemaResolver'
72-
- '@Macpaw\SchemaContextBundle\Service\BaggageCodec'
7382
```
7483

7584
## Messenger Integration
@@ -87,7 +96,7 @@ framework:
8796
buses:
8897
messenger.bus.default:
8998
middleware:
90-
- Macpaw\SchemaContextBundle\Messenger\Middleware\BaggageMiddleware
99+
- Macpaw\SchemaContextBundle\Messenger\Middleware\BaggageSchemaMiddleware
91100
```
92101

93102
## Testing

config/services.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ services:
88
public: true
99
shared: true
1010

11+
Macpaw\SchemaContextBundle\Service\BaggageCodec:
12+
public: true
13+
shared: true
14+
1115
Macpaw\SchemaContextBundle\EventListener\BaggageRequestListener:
1216
arguments:
1317
$baggageSchemaResolver: '@Macpaw\SchemaContextBundle\Service\BaggageSchemaResolver'
@@ -18,6 +22,6 @@ services:
1822
tags:
1923
- { name: kernel.event_subscriber }
2024

21-
Macpaw\SchemaContextBundle\Messenger\Middleware\BaggageMiddleware:
25+
Macpaw\SchemaContextBundle\Messenger\Middleware\BaggageSchemaMiddleware:
2226
tags:
2327
- { name: messenger.middleware }

0 commit comments

Comments
 (0)