Class AnnotationKey
- Namespace
- Kuestenlogik.Bowire.Semantics
- Assembly
- Kuestenlogik.Bowire.dll
Four-dimensional address of a schema-field annotation:
(service, method, message-type, json-path).
public sealed record AnnotationKey : IEquatable<AnnotationKey>
- Inheritance
-
AnnotationKey
- Implements
- Inherited Members
Remarks
The frame-semantics framework treats every annotation as a tag on a
specific field path inside a specific message type inside a specific
method on a specific service. Three dimensions are not enough — a
single transport channel (DIS multicast, MQTT topic, SignalR hub,
protobuf oneof, WebSocket envelope) routinely carries multiple
payload shapes, and the same JSON path can mean different things in
each. The discriminator dimension keeps those interpretations
separate.
For single-type methods (a classical REST GET, a unary gRPC
call, …) MessageType is the literal wildcard
Wildcard ("*"). The wildcard is a regular value,
not a separate case in the resolver — annotations under "*"
match by equality just like annotations under "EntityStatePdu".
Constructors
AnnotationKey(string, string, string, string)
Four-dimensional address of a schema-field annotation:
(service, method, message-type, json-path).
public AnnotationKey(string ServiceId, string MethodId, string MessageType, string JsonPath)
Parameters
ServiceIdstringPlugin-defined service identifier — the OpenAPI tag, gRPC service FQN, SignalR hub name, MQTT topic prefix, … . Always non-null and case-sensitive: two services that differ only in casing are not the same service.
MethodIdstringPlugin-defined method identifier within
ServiceId— the operationId, gRPC method name, hub-method name, … . Always non-null and case-sensitive.MessageTypestringDiscriminator value selecting which shape of message this annotation applies to. Wildcard (
"*") for single-type methods; a concrete string for multi-type channels (e.g."EntityStatePdu","PortCallScheduled"). Case-sensitive.JsonPathstringJSONPath expression rooted at the message body (
$). The resolver does an exact-string match, so$.position.latand$.position.lat(with trailing whitespace) are different keys; callers should canonicalise before constructing.
Remarks
The frame-semantics framework treats every annotation as a tag on a
specific field path inside a specific message type inside a specific
method on a specific service. Three dimensions are not enough — a
single transport channel (DIS multicast, MQTT topic, SignalR hub,
protobuf oneof, WebSocket envelope) routinely carries multiple
payload shapes, and the same JSON path can mean different things in
each. The discriminator dimension keeps those interpretations
separate.
For single-type methods (a classical REST GET, a unary gRPC
call, …) MessageType is the literal wildcard
Wildcard ("*"). The wildcard is a regular value,
not a separate case in the resolver — annotations under "*"
match by equality just like annotations under "EntityStatePdu".
Fields
Wildcard
The literal "*" used for the message-type slot when a
method carries a single payload shape (no discriminator).
public const string Wildcard = "*"
Field Value
Properties
JsonPath
JSONPath expression rooted at the message body ($). The
resolver does an exact-string match, so $.position.lat and
$.position.lat (with trailing whitespace) are different
keys; callers should canonicalise before constructing.
public string JsonPath { get; init; }
Property Value
MessageType
Discriminator value selecting which shape of message this annotation
applies to. Wildcard ("*") for single-type
methods; a concrete string for multi-type channels (e.g.
"EntityStatePdu", "PortCallScheduled"). Case-sensitive.
public string MessageType { get; init; }
Property Value
MethodId
Plugin-defined method identifier within ServiceId
— the operationId, gRPC method name, hub-method name, … . Always
non-null and case-sensitive.
public string MethodId { get; init; }
Property Value
ServiceId
Plugin-defined service identifier — the OpenAPI tag, gRPC service FQN, SignalR hub name, MQTT topic prefix, … . Always non-null and case-sensitive: two services that differ only in casing are not the same service.
public string ServiceId { get; init; }
Property Value
Methods
Deconstruct(out string, out string, out string, out string)
public void Deconstruct(out string ServiceId, out string MethodId, out string MessageType, out string JsonPath)
Parameters
Equals(AnnotationKey?)
public bool Equals(AnnotationKey? other)
Parameters
otherAnnotationKey
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
ForSingleType(string, string, string)
Convenience factory for single-type methods — fills the MessageType slot with Wildcard.
public static AnnotationKey ForSingleType(string serviceId, string methodId, string jsonPath)
Parameters
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(AnnotationKey?, AnnotationKey?)
public static bool operator ==(AnnotationKey? left, AnnotationKey? right)
Parameters
leftAnnotationKeyrightAnnotationKey
Returns
operator !=(AnnotationKey?, AnnotationKey?)
public static bool operator !=(AnnotationKey? left, AnnotationKey? right)
Parameters
leftAnnotationKeyrightAnnotationKey