Zum Inhalt springen

API reference / Quittio \ Core \ Serialization

JsonSchemaGenerator

final class in quittio/core

Quittio\Core\Serialization\JsonSchemaGenerator · Source

Generates the JSON Schema (draft 2020-12) of InvoiceData::toArray() from the constructor signatures and mapping attributes, so that the schema never drifts from the model.

Constants#

ConstantValueDescription
SCHEMA_ID'https://quittio.dev/schema/invoice.schema.json'

Methods#

MethodDescription
::defaultPath()Path of the shipped schema (resources/schema/invoice.schema.json of the core package), which JsonSchemaValidator validates against.
->generate()
->toJson()The schema of generate() as pretty-printed JSON with a trailing newline, as stored in the shipped file.

defaultPath()#

public static function defaultPath(): string

static

Path of the shipped schema (resources/schema/invoice.schema.json of the core package), which JsonSchemaValidator validates against.

Returns
string

generate()#

public function generate(): array<string, mixed>
Returns
array<string, mixed>

toJson()#

public function toJson(): string

The schema of generate() as pretty-printed JSON with a trailing newline, as stored in the shipped file.

Returns
string

Die Open-Core-Pakete stehen unter der MIT-Lizenz. Die rechtlichen Formulierungen der Länderpakete sind mit einer Steuerberatung abzustimmen.