Skip to content

feat: harden OpenAPI contracts for SDK generators#7662

Merged
vitormattos merged 9 commits intomainfrom
feat/sdk-generator-contract-hardening
May 6, 2026
Merged

feat: harden OpenAPI contracts for SDK generators#7662
vitormattos merged 9 commits intomainfrom
feat/sdk-generator-contract-hardening

Conversation

@vitormattos
Copy link
Copy Markdown
Member

Summary

  • replace weak mixed metadata aliases with explicit SDK-friendly metadata contracts
  • improve id-docs success response docblocks from array<empty> to array{}
  • regenerate OpenAPI specs and TypeScript types

Changes

  • lib/ResponseDefinitions.php
    • add LibresignDynamicMetadataValue
    • add LibresignSignerCertificateInfo
    • add LibresignSignerMetadata
    • replace LibresignSignerDetail.metadata?: mixed with metadata?: LibresignSignerMetadata
    • replace LibresignFileRuntimeMetadata = ...|array<string, mixed> with ...|array<string, LibresignDynamicMetadataValue>
  • lib/Controller/IdDocsController.php
    • @return success contracts changed from array<empty> to array{} for add/delete endpoints
  • regenerated artifacts:
    • openapi.json
    • openapi-full.json
    • src/types/openapi/openapi.ts
    • src/types/openapi/openapi-full.ts

Validation Executed

  • composer psalm (container)
  • composer openapi (container)
  • composer cs:fix (container)
  • npm run lint
  • npm run stylelint
  • npm test

All commands completed successfully.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@github-project-automation github-project-automation Bot moved this to 0. Needs triage in Roadmap May 6, 2026
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
SignRequest.getMetadata() stores notify history as array<{date: int, method: string}> entries.
The previous SignerMetadata union type caused swagger-test to attempt DynamicMetadataValue
scalar validation on the notify array, producing 'Array to string conversion' PHP warnings
in FileControllerTest (6× matchNumber, 3× matchBool per test run).

Changes:
- LibresignNotify.date: string -> non-negative-int (runtime stores Unix timestamp via time())
- LibresignNotify: add optional description field (stored when SignRequest has description)
- LibresignSignerMetadata: add notify?: LibresignNotify[] to known-fields branch
- LibresignSignerMetadata: remove |array<string, DynamicMetadataValue> fallback (all actual
  keys are now covered by the known-fields branch)

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable33

@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable32

@vitormattos vitormattos merged commit bb755d6 into main May 6, 2026
77 checks passed
@vitormattos vitormattos deleted the feat/sdk-generator-contract-hardening branch May 6, 2026 20:39
@github-project-automation github-project-automation Bot moved this from 0. Needs triage to 4. to release in Roadmap May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 4. to release

Development

Successfully merging this pull request may close these issues.

1 participant