Skip to content

feat: integrate seatplus/esi-schema — DTOs from esi-schema, direct DTO returns#23

Merged
herpaderpaldent merged 1 commit into
feat/esi-rate-limit-overhaulfrom
feat/esi-schema-integration
May 11, 2026
Merged

feat: integrate seatplus/esi-schema — DTOs from esi-schema, direct DTO returns#23
herpaderpaldent merged 1 commit into
feat/esi-rate-limit-overhaulfrom
feat/esi-schema-integration

Conversation

@herpaderpaldent
Copy link
Copy Markdown
Contributor

Summary

Integrates seatplus/esi-schema as the source of truth for all ESI response DTOs and changes object-endpoint methods to return DTOs directly instead of wrapping them in EsiResult<T>.

Note: This PR is stacked on top of PR #22 (feat/esi-rate-limit-overhaul). Merge that one first.


What changed

seatplus/esi-schema dependency

  • Added "seatplus/esi-schema": "1.x-dev" + VCS repository to composer.json
  • src/Generated/Responses/ deleted (218 files removed) — all DTOs now come from esi-schema

Generator (bin/generate.php)

  • No longer generates DTO files — resources only
  • All DTO use statements changed to Seatplus\EsiSchema\Responses\*

Resource return types

Endpoint type Before After
Single object (e.g. getAlliancesAllianceId) EsiResult<AllianceDetail> AllianceDetail
Paginated list (e.g. getCharactersCharacterIdAssets) EsiResult<array<T>> EsiResult<array<T>> (unchanged)
Primitive array / scalar EsiResult<T> EsiResult<T> (unchanged)

Object DTOs extend AbstractEsiDto so $dto->isCachedLoad and $dto->pages are available directly on the returned DTO:

$alliance = $sdk->alliance()->getAlliancesAllianceId(99000006);
echo $alliance->name;        // AllianceDetail — no ->data unwrapping
$alliance->isCachedLoad;     // bool
$alliance->pages;            // int (1 for non-paginated)

README

Added ESI compatibility date notice:

This branch targets ESI compatibility date 2025-12-16 and forward.


Quality gates

  • ✅ Pint: clean
  • ✅ PHPStan level 4: 0 errors
  • ✅ Pest: 86 passed / 160 assertions

… endpoints

- Require seatplus/esi-schema:1.x-dev (VCS from github.com/seatplus/esi-schema)
- Delete src/Generated/Responses/ — all DTOs now come from seatplus/esi-schema
- Generator: no longer generates DTO files, only Resources
- Generator: all DTO imports changed to Seatplus\EsiSchema\Responses\*
- Object endpoints (single-object responses) now return the DTO directly
  instead of wrapping in EsiResult<T>. The DTO extends AbstractEsiDto
  so $dto->isCachedLoad and $dto->pages are available on the result.
- Paginated array endpoints keep EsiResult<array<T>> (pages metadata required)
- Update tests to reflect new return types
- Update README: compatibility date notice + new SDK usage examples
- ESI compatibility date: 2025-12-16 and forward

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@herpaderpaldent
Copy link
Copy Markdown
Contributor Author

Merged directly into #22.

@herpaderpaldent herpaderpaldent merged commit 8b81b0d into feat/esi-rate-limit-overhaul May 11, 2026
1 check passed
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