CrystalJsonSelfSerializableAttribute

Namespace: SnowBank.Data.Json · class

Implements: Attribute

Meta-attribute that marks another attribute as enabling JSON source code generation on the types it decorates

Remarks

Apply this attribute to a custom attribute class: any (partial) type decorated with that attribute becomes self-serializable, meaning the source generator emits its converter and proxies nested inside the type itself (ex: Widget.ReadOnly, Widget.Writable, Widget.Default), without requiring a separate container class.

This allows a library to opt its own marker attributes into JSON code generation, without the application having to reference the generator vocabulary directly.

Sample: // in the library: [CrystalJsonSelfSerializable] public sealed class DocumentAttribute : Attribute // in the application: [Document] public sealed partial record Widget // gets Widget.ReadOnly, Widget.Writable, Widget.Default, ...

Constructors

CrystalJsonSelfSerializableAttribute

CrystalJsonSelfSerializableAttribute()