JSON to Smithy Converter
Generate Smithy structures from sample JSON when you want contract-first service models instead of language-specific DTO classes.
How to use
Paste a representative JSON payload that matches the request or response document you want to model at the contract layer.
Review the generated Smithy `structure` definitions, required markers, and `Document` usage for flexible or repeated fields.
Copy the output into your Smithy model package and refine namespaces, traits, or service operations around the generated shapes.
Benefits
Produces contract-first Smithy structures that can guide multi-language service design before implementation.
Keeps payload intent focused on API schemas instead of one runtime’s DTO conventions.
Makes it easier to turn example JSON into shareable interface definitions for platform teams.
Best use cases
API platform teams authoring Smithy models from real request and response examples.
Service contracts that need a typed schema before generating clients or server stubs.
Projects comparing payload samples while deciding which fields should become explicit Smithy shapes.
Smithy structure tips
Review which generated fields should stay `@required` before promoting the output into a long-lived service contract.
Refine `Document` usage into more explicit list or map shapes later when the payload semantics are stable enough.
Treat this route as a schema-authoring aid, not a final service model replacement without architectural review.
Sample JSON
{
"id": 101,
"name": "Ada Lovelace",
"active": true,
"roles": ["admin", "editor"],
"profile": {
"email": "ada@example.com",
"score": 9.8
}
}
Sample Smithy output
$version: "2"
namespace jsonformatter.generated
use smithy.api#Document
structure UserModel {
@required
id: Integer,
@required
name: String,
@required
active: Boolean,
@required
roles: Document
}
FAQ
Why use the Smithy route instead of Scala3 or PHP output? Choose the Smithy route when you are modeling an API contract itself rather than generating runtime DTO classes for a single language like Scala or PHP.
Does the Smithy route preserve nested payload structure? Yes. Nested objects become Smithy structures, and flexible or repeated values can be represented with `Document` until you refine them into stricter shapes.
Related tools