error schema-attr
Некорректный атрибут сериализации (@tag, @v, @since, @removed, @renamed, @zigzag, @repr, @codec).
What it means#
An attribute of the serialization schema is malformed or used in the wrong place:
@tag(n)needs a number in 1..536870911 outside protobuf's reserved range 19000..19999, unique within the type, and not a tag reserved by@removed;@v(n)and@since(n)need a version >= 1;@removed(N, "member")is written on the type (D-2108), names a member that no longer exists, and optionallytag: T;@renamed(from: "old")needs the old name;@zigzagapplies to integer fields and types;@repr(W)needsimpl Repr<W> for T;@codec(C)/@codec(json: C1, oxl: C2)need codec types withimpl Codec<T> for C.
Example#
data Order {
@tag(1) id: i64
@tag(1) total: i64 // <- schema-attr
}error
schema-attr
How to fix#
Give every field its own tag or drop the explicit tags and let the compiler assign them (the assignment is recorded in oxl.schema.lock). For a removed field keep the type attribute @removed(2, "total") instead of reusing the number.