Skip to content

JSON export of the decoded model in library and CLI (fixes #20) - #36

Merged
mahach666 merged 4 commits into
mainfrom
feat/issue-20-json-export
Nov 14, 2026
Merged

mahach666 merged 4 commits into
mainfrom
feat/issue-20-json-export

Conversation

@mahach666

Copy link
Copy Markdown
Contributor

Resolves #20.

Summary of Changes:

  • Library JSON Export:
    • Added \TeklaModel.ToJson(bool indented = false), \TeklaModel.WriteJson(Stream stream, bool indented = false), and \TeklaModel.WriteJson(Utf8JsonWriter writer).
    • Serializes model metadata (\modelGuid, \�ersion, \counts), assemblies (with parts, main part, bolts, welds, marks, attributes), parts (with profile, material, coordinates, lengths, marks, attributes), bolts (with connected parts, holes, pattern coordinates), and welds.
  • CLI Export Command:
    • Added \ dbio export [--indent]\ command in \TdbIO.Cli.
    • Exports decoded model to JSON stream with optional formatted indentation.
  • Tests & Docs:
    • Added unit tests in \ ests/TdbIO.Tests/JsonExportTests.cs\ validating JSON output across all real models.
    • Added CLI tests in \ ests/TdbIO.Tests/CliTests.cs\ for the \export\ command.
    • Updated \docs/public-api.md.

@mahach666 mahach666 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not merge yet: export can throw an unhandled exception for malformed numeric input. This branch also includes the unresolved decoder/builder problems tracked in #33 and #35; fixing export alone will not make its model data correct.

Comment thread src/TdbIO/Internal/ModelJsonWriter.cs Resolved
@mahach666
mahach666 force-pushed the feat/issue-20-json-export branch from a2ee5c8 to 3357100 Compare November 14, 2026 10:35

@mahach666 mahach666 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked the updated code and the original synthetic regressions on net8.0/net10.0. The unhandled NaN exception is fixed. Two remaining P2 issues are attached: loss of the actual input offset and a CLI test that fails before reaching numeric validation. The unresolved string-chain ordering issue in #35 also affects this branch.

Comment thread src/TdbIO/Internal/ModelJsonWriter.cs Resolved
Comment thread tests/TdbIO.Tests/CliTests.cs Resolved
@mahach666
mahach666 force-pushed the feat/issue-20-json-export branch from 3357100 to e21a8fc Compare November 14, 2026 11:13
@mahach666
mahach666 merged commit ece81de into main Nov 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON export of the decoded model

1 participant