# tnaldoza/jx-schema-generator architecture

> Architecture diagram of the GitHub repository tnaldoza/jx-schema-generator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tnaldoza/jx-schema-generator
- Repository: https://github.com/tnaldoza/jx-schema-generator

## Overview

JXSchemaGenerator is a .NET CLI that compiles Jack Henry jXchange TPG XSDs into one format-2 JSON mapping per Master, plus a JSON Schema. The documented workflow runs from CLI arguments through folder-level generation, schema loading, Master building, and JSON emission; SOAP clients consume the resulting mappings. The graph preserves schema resolution, operation discovery, request/response trees, type tables, and output naming as distinct capabilities. Some build-stage links rely on README descriptions rather than sampled implementation, so those links are dashed and unverified.

Main entry points: [`src/JXSchemaGenerator.Core/Build/MasterBuilder.cs`](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Build/MasterBuilder.cs) (Master builder), [`src/JXSchemaGenerator.Core/Build/GenerateRunner.cs`](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Build/GenerateRunner.cs) (Folder runner), [`src/JXSchemaGenerator.Core/Emit/MasterJsonWriter.cs`](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Emit/MasterJsonWriter.cs) (JSON writer), [`src/JXSchemaGenerator.Core/Schema/SchemaLoader.cs`](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Schema/SchemaLoader.cs) (Schema loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and orchestration"]
  node_cli["Generate CLI<br/>[Program.cs]"]
  node_runner["Folder runner<br/>[GenerateRunner.cs]"]
end

subgraph group_schema["Schema processing"]
  node_loader["Schema loader<br/>[SchemaLoader.cs]"]
  node_resolver["Local resolver"]
  node_index["Schema index<br/>[SchemaIndex.cs]"]
end

subgraph group_build["Master construction"]
  node_master["Master builder<br/>[MasterBuilder.cs]"]
  node_operations["Operation discovery"]
  node_annotations["Annotation reader"]
  node_elements["Element trees"]
  node_types["Type table"]
  node_helpers["Operation helpers"]
  node_model["Master document model<br/>[Model]"]
end

subgraph group_output["JSON output"]
  node_writer["JSON writer"]
  node_names["Output naming<br/>[OutputFileNames.cs]"]
  node_schemajson["Format JSON Schema"]
end

node_engineer(("CLI user"))
node_xsd["TPG XSD folder"]
node_outputs["Generated JSON mappings"]
node_clients(("SOAP client libraries"))

node_engineer -->|"runs"| node_cli
node_cli -->|"invokes"| node_runner
node_runner -.->|"loads schemas"| node_loader
node_loader -->|"resolves locally"| node_resolver
node_xsd -->|"provides schemas"| node_loader
node_loader -.->|"indexes types"| node_index
node_runner -.->|"builds Masters"| node_master
node_master -.->|"discovers operations"| node_operations
node_master -.->|"reads annotations"| node_annotations
node_master -.->|"builds element trees"| node_elements
node_master -.->|"builds type table"| node_types
node_master -.->|"derives helpers"| node_helpers
node_master -.->|"uses schema index"| node_index
node_master -.->|"produces document"| node_model
node_runner -.->|"emits JSON"| node_writer
node_runner -.->|"names files"| node_names
node_writer -->|"serializes"| node_model
node_writer -->|"ships schema"| node_schemajson
node_writer -->|"writes mappings"| node_outputs
node_names -.->|"names files"| node_outputs
node_schemajson -->|"documents format"| node_outputs
node_outputs -->|"consumed by"| node_clients

click node_cli "https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Cli/Program.cs"
click node_runner "https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Build/GenerateRunner.cs"
click node_loader "https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Schema/SchemaLoader.cs"
click node_resolver "https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Schema/LocalFolderXmlResolver.cs"
click node_index "https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Schema/SchemaIndex.cs"
click node_master "https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Build/MasterBuilder.cs"
click node_operations "https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Build/OperationDiscovery.cs"
click node_annotations "https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Build/AnnotationReader.cs"
click node_elements "https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Build/ElementTreeBuilder.cs"
click node_types "https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Build/TypeTableBuilder.cs"
click node_helpers "https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Build/OperationHelpers.cs"
click node_model "https://github.com/tnaldoza/jx-schema-generator/tree/master/src/JXSchemaGenerator.Core/Model"
click node_writer "https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Emit/MasterJsonWriter.cs"
click node_names "https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Emit/OutputFileNames.cs"
click node_schemajson "https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Emit/jxchange-schemas.schema.json"

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_cli,node_runner,node_engineer,node_clients toneBlue
class node_loader,node_resolver,node_index toneAmber
class node_master,node_operations,node_annotations,node_elements,node_types,node_helpers,node_model toneMint
class node_writer,node_names,node_schemajson toneRose
class node_xsd,node_outputs toneIndigo
```

## Components

### CLI and orchestration

- [Generate CLI](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Cli/Program.cs): `src/JXSchemaGenerator.Cli/Program.cs`
- [Folder runner](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Build/GenerateRunner.cs): `src/JXSchemaGenerator.Core/Build/GenerateRunner.cs`

### Schema processing

- [Schema loader](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Schema/SchemaLoader.cs): `src/JXSchemaGenerator.Core/Schema/SchemaLoader.cs`
- [Local resolver](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Schema/LocalFolderXmlResolver.cs): `src/JXSchemaGenerator.Core/Schema/LocalFolderXmlResolver.cs`
- [Schema index](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Schema/SchemaIndex.cs): `src/JXSchemaGenerator.Core/Schema/SchemaIndex.cs`

### Master construction

- [Master builder](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Build/MasterBuilder.cs): `src/JXSchemaGenerator.Core/Build/MasterBuilder.cs`
- [Operation discovery](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Build/OperationDiscovery.cs): `src/JXSchemaGenerator.Core/Build/OperationDiscovery.cs`
- [Annotation reader](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Build/AnnotationReader.cs): `src/JXSchemaGenerator.Core/Build/AnnotationReader.cs`
- [Element trees](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Build/ElementTreeBuilder.cs): `src/JXSchemaGenerator.Core/Build/ElementTreeBuilder.cs`
- [Type table](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Build/TypeTableBuilder.cs): `src/JXSchemaGenerator.Core/Build/TypeTableBuilder.cs`
- [Operation helpers](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Build/OperationHelpers.cs): `src/JXSchemaGenerator.Core/Build/OperationHelpers.cs`
- [Master document model](https://github.com/tnaldoza/jx-schema-generator/tree/master/src/JXSchemaGenerator.Core/Model): `src/JXSchemaGenerator.Core/Model`

### JSON output

- [JSON writer](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Emit/MasterJsonWriter.cs): `src/JXSchemaGenerator.Core/Emit/MasterJsonWriter.cs`
- [Output naming](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Emit/OutputFileNames.cs): `src/JXSchemaGenerator.Core/Emit/OutputFileNames.cs`
- [Format JSON Schema](https://github.com/tnaldoza/jx-schema-generator/blob/master/src/JXSchemaGenerator.Core/Emit/jxchange-schemas.schema.json): `src/JXSchemaGenerator.Core/Emit/jxchange-schemas.schema.json`

### Other components

- **CLI user**
- **TPG XSD folder**
- **Generated JSON mappings**
- **SOAP client libraries**

## Connections

- CLI user → Generate CLI: runs (evidence: `README.md`)
- Generate CLI → Folder runner: invokes (evidence: `src/JXSchemaGenerator.Cli/Program.cs`)
- Folder runner → Schema loader: loads schemas
- Schema loader → Local resolver: resolves locally (evidence: `src/JXSchemaGenerator.Core/Schema/SchemaLoader.cs`)
- TPG XSD folder → Schema loader: provides schemas (evidence: `README.md`)
- Schema loader → Schema index: indexes types
- Folder runner → Master builder: builds Masters
- Master builder → Operation discovery: discovers operations
- Master builder → Annotation reader: reads annotations
- Master builder → Element trees: builds element trees
- Master builder → Type table: builds type table
- Master builder → Operation helpers: derives helpers
- Master builder → Schema index: uses schema index
- Master builder → Master document model: produces document
- Folder runner → JSON writer: emits JSON
- Folder runner → Output naming: names files
- JSON writer → Master document model: serializes (evidence: `src/JXSchemaGenerator.Core/Emit/MasterJsonWriter.cs`)
- JSON writer → Format JSON Schema: ships schema (evidence: `src/JXSchemaGenerator.Core/Emit/MasterJsonWriter.cs`)
- JSON writer → Generated JSON mappings: writes mappings (evidence: `README.md`)
- Output naming → Generated JSON mappings: names files
- Format JSON Schema → Generated JSON mappings: documents format (evidence: `README.md`)
- Generated JSON mappings → SOAP client libraries: consumed by (evidence: `README.md`)
