Skip to content

API Endpoint Verification & Schema Capture #916

@matKlju

Description

@matKlju

AS A Service-Module developer
I WANT a backend-run Test URL that verifies API endpoints and stores verification results + response schema
SO THAT verified APIs and schemas are shared globally without blocking service creation (#871)

Description

Implement one shared backend Test URL operation used by:

  • Global API create/edit modal
  • Canvas-level API node edit modal
  • API varamu page (Teenused → API-d)

Acceptance Criteria

Execution

  • Single backend verification logic used by all UIs
  • Request built from:
    • Stored endpoint definition (method, path/url/openApiUrl)
    • User-provided test values (params, headers, body)
  • Supported methods: GET, POST
  • Explicit safety bounds: timeoutMs, maxResponseBytes
  • JSON object-root and array-root responses supported

Persistence

  • Test inputs are not persisted
  • Persisted fields:
    • verificationStatus ∈ { unverified, verified, failed }
    • lastTestAt
    • lastStatusCode
    • schemaCaptured
    • schemaStored (normalized, stable schema)

Schema overwrite rule

  • On successful test (2xx):
    • schemaStored is overwritten with the newly captured schema
    • schemaCaptured = true
    • verificationStatus = verified
  • On failed test (non-2xx, timeout, network error):
    • verificationStatus = failed
    • schemaCaptured = false
    • schemaStored is NOT overwritten (last known good schema is preserved)
  • Empty body (204 / {}) → treated as successful test with empty schema

UI Contract

  • Verification state shown consistently in all UIs
  • Verified + schemaCaptured → response fields available in Assign
  • Unverified/failed → explicit warning
  • Save/create is never blocked by verification state

Concurrency & Errors

  • Concurrent runs → last write wins
  • Optional UI-safe error category persisted
    (validation | network | timeout | http | non_json | unknown)

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Ready

Status

Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions