Private beta, by invitation. It may change without warning. While the beta lasts, some paid features are free. See pricing

trumlyspec GitHub
Try trumly

← Packs

api

VerifiedEnrichment0.3.2

Use when: When the system offers an API and you need its contract: the resources, endpoints, schemas, errors and how each is secured.

An API as a contract: resources and endpoints, the schemas they accept and return, the errors they raise and how each is secured. Rules refuse an endpoint with no response, no error cases or no stated security.

Add it

Open it in trumly cloud to start a project with this pack already in. In an existing project, open the editor's Packs tab, choose api, then Add. Nodes you change after adding are kept when the pack is upgraded.

From a known source. Reviewed by us, and the publisher is known.

Explore is a read-only demo in your browser: nothing to sign in to, and nothing is saved.

Namespace
api--
Size
33 nodes
Needs
core@^1.0.0
Works with
links@^1.0.0, dns@^0.4.0
Enriches
interface
Publisher
trumly
Versions
0.3.2·0.3.1·0.3.0·0.2.0
Checksum
919b3678b5687911…

Examples 1

  • The ops API as a contractA starting point

    One resource, an endpoint that returns a schema and says how it fails and how it is secured, and an event, all attached to the ops API interface.

    32 nodes29 typesneeds core

    Show the 32 nodes
    • Jobs listedacceptance-criterionacceptance-criterion-jobs-listed
    • Ops staffactoractor-ops-staff
    • Job volume stays modestassumptionassumption-job-volume
    • Bearer tokenapi-authauth-bearer
    • View job statuscapabilitycapability-view-job-status
    • Ops APIcomponentcomponent-ops-api
    • Jobconceptconcept-job
    • Vertical scalingconsequenceconsequence-one-engine
    • Data stays in UK/EUconstraintconstraint-uk-eu-data
    • Short titlesconventionconvention-short-titles
    • Ops dbdatastoredatastore-ops-db
    • Managed document storedecision-optiondecision-option-document-store
    • Managed PostgreSQLdecision-optiondecision-option-managed-postgres
    • Database choicedecisiondecision-use-postgres
    • Productionenvironmentenvironment-production
    • List jobsapi-endpointep-list-jobs
    • Bad requestapi-errorerr-bad-request
    • Job changedapi-eventevt-job-changed
    • Timely ops visibilitygoalgoal-timely-visibility
    • Live job statusincrementincrement-live-status
    • Ops APIinterfaceinterface-ops-api
    • Job status agemetricmetric-status-freshness
    • Ops APIoverviewoverview
    • Prefer managed servicesprincipleprinciple-prefer-managed
    • List jobsrequirementrequirement-list-jobs
    • Jobapi-resourceres-job
    • Job volume growthriskrisk-job-volume-growth
    • Jobapi-schemaschema-job
    • Job listapi-schemaschema-job-list
    • Devteamteam-dev
    • Platformteamteam-platform
    • Build status APIwork-packagework-package-build-status-api

Planes 2

  • Surface
  • Contract

Types 6

  • api-authHow a caller proves who they are.
  • api-endpointOne operation a caller can make.
  • api-errorA way a call can fail, and what the caller sees.
  • api-eventA message the API publishes when something happens.
  • api-resourceA thing the API lets callers work with.
  • api-schemaThe shape of a request, response or message body.

Link types 7

  • acceptsapi-endpoint → api-schemaThe endpoint takes this body.
  • fails-withapi-endpoint → api-errorThe endpoint can fail this way.
  • operates-onapi-endpoint → api-resourceThe endpoint works on this resource.
  • payloadapi-event → api-schemaThe event carries this body.
  • returnsapi-endpoint → api-schemaThe endpoint answers with this body.
  • secured-byapi-endpoint, api-event → api-authCallers must satisfy this to use the endpoint.
  • served-byapi-endpoint → anyThe component that implements this endpoint.

Calculated values 2

  • operation{method} {path}The method and path of an endpoint, such as GET /jobs.
  • urlhttps://{served-by/runs-in/^serves/title}{path}The full address of an endpoint, one for each hostname that serves it.

Rules 16

  • ErrorEvery auth names its scheme
  • WarningA built endpoint is served by something
  • WarningA PATCH endpoint accepts a schema
  • WarningA POST endpoint accepts a schema
  • WarningA PUT endpoint accepts a schema
  • WarningEvery endpoint documents its error cases
  • ErrorEvery endpoint states its method and path
  • ErrorEvery endpoint says whether it is public
  • WarningEvery endpoint operates on a resource
  • WarningEvery endpoint returns a schema
  • ErrorA non-public endpoint is secured
  • WarningEvery endpoint satisfies a requirement
  • ErrorEvery error states its status code
  • ErrorEvery event carries a schema
  • WarningEvery event says how consumers are authorised
  • InfoEvery schema is used by an endpoint or event