Skip to content

Convert NieuwbouwOffice to a Saloon connector#1

Merged
jhhazelaar merged 2 commits intomainfrom
feature/saloon-connector
May 5, 2026
Merged

Convert NieuwbouwOffice to a Saloon connector#1
jhhazelaar merged 2 commits intomainfrom
feature/saloon-connector

Conversation

@jhhazelaar
Copy link
Copy Markdown
Member

Summary

  • Add saloonphp/saloon as a runtime dependency
  • Turn NieuwbouwOffice into a Saloon\Http\Connector with sensible defaults
  • Replace the placeholder example test with focused connector tests

Details

  • NieuwbouwOffice now extends Saloon\Http\Connector and uses the AcceptsJson and AlwaysThrowOnErrors plugins.
  • Constructor takes a required $token and an optional $baseUrl (defaults to https://api.nbo.nl/rest) so staging/test environments can override it.
  • defaultAuth() returns a TokenAuthenticator with the apikey prefix, so requests are sent with Authorization: apikey <token> instead of Bearer <token>.

Tests

  • Asserts the connector extends Saloon's Connector.
  • Asserts the default base URL and that it is overridable via the constructor.
  • Asserts the authenticator type, token, and prefix.
  • Asserts outgoing requests carry the Authorization: apikey <token> and Accept: application/json headers via createPendingRequest().

All 7 tests pass locally with vendor/bin/pest.

jhhazelaar and others added 2 commits May 5, 2026 15:50
Add saloonphp/saloon as a runtime dependency and turn the SDK entry point
into a Connector with a default https://api.nbo.nl/rest base URL, JSON
accept header, automatic error throwing, and apikey-prefixed token auth.
Replace the example test with focused tests covering base URL handling,
authenticator configuration, and outgoing request headers.
@jhhazelaar jhhazelaar merged commit fb55ab6 into main May 5, 2026
@jhhazelaar jhhazelaar deleted the feature/saloon-connector branch May 5, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant