# toveal/jsonschema-1c architecture

> Architecture diagram of the GitHub repository toveal/jsonschema-1c, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/toveal/jsonschema-1c
- Repository: https://github.com/toveal/jsonschema-1c

## Overview

This Rust Native API component lets 1С clients configure JSON Schema validation, install a main schema and supporting schemas, then check JSON and retrieve validation errors. The central component exposes the bilingual properties and methods, converts 1С values, compiles schemas with draft, format, and retrieval options, and formats results. The README documents additional schema-management and validation operations; some method bodies were not included in the excerpts, so those branches are shown only where supported. The graph reflects sampled source and README evidence, not unsampled implementation details.

Main entry points: [`src/json_schema_1c.rs`](https://github.com/toveal/jsonschema-1c/blob/main/src/json_schema_1c.rs) (Validation methods), [`src/tools.rs`](https://github.com/toveal/jsonschema-1c/blob/main/src/tools.rs) (1С value conversion), [`src/lib.rs`](https://github.com/toveal/jsonschema-1c/blob/main/src/lib.rs) (Native API entry), [`src/retrieve_handler.rs`](https://github.com/toveal/jsonschema-1c/blob/main/src/retrieve_handler.rs) (Schema retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["1С interface"]
  node_native["Native API entry<br/>[lib.rs]"]
  node_component["Component dispatch<br/>[json_schema_1c.rs]"]
  node_methods["Validation methods<br/>[json_schema_1c.rs]"]
  node_properties["Component properties<br/>[json_schema_1c.rs]"]
end

subgraph group_validation["Schema validation"]
  node_schema["Schema configuration<br/>[json_schema_1c.rs]"]
  node_compiler["Schema compiler<br/>[json_schema_1c.rs]"]
  node_validator["JSON Schema engine"]
  node_registry[("Schema registry<br/>[json_schema_1c.rs]")]
  node_retriever["Schema retrieval"]
end

subgraph group_support["Validation support"]
  node_formats["Custom formats<br/>[formats.rs]"]
  node_results["Validation results<br/>[json_schema_1c.rs]"]
end

subgraph group_errors["Errors and conversion"]
  node_params["1С value conversion<br/>[tools.rs]"]
  node_errors["Error handling<br/>[errors.rs]"]
end

node_client(("1С client"))

node_client -->|"creates component"| node_native
node_native -->|"instantiates"| node_component
node_component -->|"dispatches calls"| node_methods
node_component -->|"dispatches access"| node_properties
node_methods -->|"reads inputs"| node_params
node_properties -->|"converts values"| node_params
node_methods -->|"uses configured schema"| node_schema
node_schema -->|"compiles schema"| node_compiler
node_compiler -->|"builds validator"| node_validator
node_validator -->|"validates JSON"| node_results
node_methods -->|"collects errors"| node_results
node_compiler -->|"registers formats"| node_formats
node_compiler -->|"configures retrieval"| node_retriever
node_retriever -->|"reads schemas"| node_registry
node_methods -->|"manages schemas"| node_registry
node_methods -->|"reports failures"| node_errors
node_params -->|"returns conversion errors"| node_errors
node_results -->|"returns results"| node_params

click node_native "https://github.com/toveal/jsonschema-1c/blob/main/src/lib.rs"
click node_component "https://github.com/toveal/jsonschema-1c/blob/main/src/json_schema_1c.rs"
click node_methods "https://github.com/toveal/jsonschema-1c/blob/main/src/json_schema_1c.rs"
click node_properties "https://github.com/toveal/jsonschema-1c/blob/main/src/json_schema_1c.rs"
click node_params "https://github.com/toveal/jsonschema-1c/blob/main/src/tools.rs"
click node_schema "https://github.com/toveal/jsonschema-1c/blob/main/src/json_schema_1c.rs"
click node_compiler "https://github.com/toveal/jsonschema-1c/blob/main/src/json_schema_1c.rs"
click node_registry "https://github.com/toveal/jsonschema-1c/blob/main/src/json_schema_1c.rs"
click node_retriever "https://github.com/toveal/jsonschema-1c/blob/main/src/retrieve_handler.rs"
click node_formats "https://github.com/toveal/jsonschema-1c/blob/main/src/formats.rs"
click node_errors "https://github.com/toveal/jsonschema-1c/blob/main/src/errors.rs"
click node_results "https://github.com/toveal/jsonschema-1c/blob/main/src/json_schema_1c.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_native,node_component,node_methods,node_properties,node_client toneBlue
class node_schema,node_compiler,node_validator,node_registry,node_retriever toneAmber
class node_formats,node_results toneMint
class node_params,node_errors toneRose
```

## Components

### 1С interface

- [Native API entry](https://github.com/toveal/jsonschema-1c/blob/main/src/lib.rs): `src/lib.rs`
- [Component dispatch](https://github.com/toveal/jsonschema-1c/blob/main/src/json_schema_1c.rs): `src/json_schema_1c.rs`
- [Validation methods](https://github.com/toveal/jsonschema-1c/blob/main/src/json_schema_1c.rs): `src/json_schema_1c.rs`
- [Component properties](https://github.com/toveal/jsonschema-1c/blob/main/src/json_schema_1c.rs): `src/json_schema_1c.rs`

### Schema validation

- [Schema configuration](https://github.com/toveal/jsonschema-1c/blob/main/src/json_schema_1c.rs): `src/json_schema_1c.rs`
- [Schema compiler](https://github.com/toveal/jsonschema-1c/blob/main/src/json_schema_1c.rs): `src/json_schema_1c.rs`
- **JSON Schema engine**
- [Schema registry](https://github.com/toveal/jsonschema-1c/blob/main/src/json_schema_1c.rs): `src/json_schema_1c.rs`
- [Schema retrieval](https://github.com/toveal/jsonschema-1c/blob/main/src/retrieve_handler.rs): `src/retrieve_handler.rs`

### Validation support

- [Custom formats](https://github.com/toveal/jsonschema-1c/blob/main/src/formats.rs): `src/formats.rs`
- [Validation results](https://github.com/toveal/jsonschema-1c/blob/main/src/json_schema_1c.rs): `src/json_schema_1c.rs`

### Errors and conversion

- [1С value conversion](https://github.com/toveal/jsonschema-1c/blob/main/src/tools.rs): `src/tools.rs`
- [Error handling](https://github.com/toveal/jsonschema-1c/blob/main/src/errors.rs): `src/errors.rs`

### Other components

- **1С client**

## Connections

- 1С client → Native API entry: creates component (evidence: `src/lib.rs`)
- Native API entry → Component dispatch: instantiates (evidence: `src/lib.rs`)
- Component dispatch → Validation methods: dispatches calls (evidence: `src/json_schema_1c.rs`)
- Component dispatch → Component properties: dispatches access (evidence: `src/json_schema_1c.rs`)
- Validation methods → 1С value conversion: reads inputs (evidence: `src/json_schema_1c.rs`)
- Component properties → 1С value conversion: converts values (evidence: `src/json_schema_1c.rs`)
- Validation methods → Schema configuration: uses configured schema (evidence: `src/json_schema_1c.rs`)
- Schema configuration → Schema compiler: compiles schema (evidence: `src/json_schema_1c.rs`)
- Schema compiler → JSON Schema engine: builds validator (evidence: `src/json_schema_1c.rs`)
- JSON Schema engine → Validation results: validates JSON (evidence: `src/json_schema_1c.rs`)
- Validation methods → Validation results: collects errors (evidence: `src/json_schema_1c.rs`)
- Schema compiler → Custom formats: registers formats (evidence: `src/json_schema_1c.rs`)
- Schema compiler → Schema retrieval: configures retrieval (evidence: `src/json_schema_1c.rs`)
- Schema retrieval → Schema registry: reads schemas (evidence: `src/retrieve_handler.rs`)
- Validation methods → Schema registry: manages schemas (evidence: `README.md`)
- Validation methods → Error handling: reports failures (evidence: `src/json_schema_1c.rs`)
- 1С value conversion → Error handling: returns conversion errors (evidence: `src/tools.rs`)
- Validation results → 1С value conversion: returns results (evidence: `src/json_schema_1c.rs`)
