Skip to content

[F] $segment

function $segment(
context,
entity,
name
): void;

@segment defines the preceding path segment for a @path parameter in auto-generated routes

The first argument should be a string that will be inserted into the operation route before the path parameter’s name field.

On an operation, the segment follows its path parameters. On a model, it supplies a resource segment when the model has no key, as used by singleton resources.

ParameterType
contextDecoratorContext
entityOperation | Model | ModelProperty
namestring

void