Skip to content

return-without-relationship

A Dynamic View return Step has no Relationship the other way, from its to to its from.

Severity: error · Since: v1.0.0

For the failing example below, archidocs check prints:

shop/services.yaml:28:11 error return-without-relationship A return from "shop:web" to "shop:cart" needs a Relationship from "shop:cart" to "shop:web"

A return Step is the provider’s reply to a consumer, so it follows a Relationship the other way round: from its to to its from. With no such Relationship there is no call for it to be the reply to.

shop/services.yaml:

services:
web:
name: Web
relationships:
- to: cart
cart:
name: Cart
components:
cart-api:
name: Cart API
orders:
name: Orders
events:
name: Events
type: broker
mailer:
name: Mailer
relationships:
- to: orders
interaction: async
via: events
channel: order-placed
views:
dynamic:
purchase:
title: Purchase
steps:
- { from: web, to: cart, return: true }

Turn the Step round, or remove return: true if it is a call of its own.

shop/services.yaml:

services:
web:
name: Web
relationships:
- to: cart
cart:
name: Cart
components:
cart-api:
name: Cart API
orders:
name: Orders
events:
name: Events
type: broker
mailer:
name: Mailer
relationships:
- to: orders
interaction: async
via: events
channel: order-placed
views:
dynamic:
purchase:
title: Purchase
steps:
- { from: web, to: cart }
- { from: cart, to: web, return: true }
  • return-on-async: A Dynamic View return Step resolves to an async Relationship, which has no reply.
  • missing-step: A Dynamic View Step has no Relationship or derived edge between from and to (nor a via subscription of to to from), or the named relationship doesn’t connect them.

Documents the beta branch at cd98671, ahead of the latest release, v1.4.0.