Spectra class

Marks a class for schema generation.

Apply this annotation to classes that should have schemas generated. Works with @freezed, @JsonSerializable, and plain Dart classes.

@Spectra(
  title: 'User',
  description: 'A user in the system',
)
class User {
  final String name;
  final int age;
}

Constructors

Spectra({String? title, String? description, Set<SpectraFormat>? formats, bool additionalProperties = false})
Creates a new Spectra annotation.
const

Properties

additionalProperties bool
Whether to allow additional properties not defined in the schema.
final
description String?
Optional description for the schema.
final
formats Set<SpectraFormat>?
Output formats to generate.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String?
Optional title for the schema.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited