zio.http.gen.smithy

Members list

Type members

Classlikes

final case class Member(name: String, target: ShapeId, traits: List[SmithyTrait] = ..., defaultValue: Option[NodeValue] = ...)

Attributes

Source
Smithy.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait NodeValue

Smithy IDL Parser and AST

Smithy IDL Parser and AST

Implements parsing of Smithy 2.0 IDL specifications as defined in: https://smithy.io/2.0/spec/idl.html

Attributes

Companion
object
Source
Smithy.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Arr
class Bool
object Null
class Num
class Obj
class ShapeIdValue
class Str
Show all
object NodeValue

Attributes

Companion
trait
Source
Smithy.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
NodeValue.type
sealed trait Shape

Attributes

Companion
object
Source
Smithy.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Shape

Attributes

Companion
trait
Source
Smithy.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Shape.type
final case class ShapeId(namespace: Option[String], name: String, member: Option[String] = ...)

A shape ID uniquely identifies a shape in the Smithy model. Format: [namespace#]name[$ member]

A shape ID uniquely identifies a shape in the Smithy model. Format: [namespace#]name[$ member]

Attributes

Companion
object
Source
Smithy.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ShapeId

Attributes

Companion
class
Source
Smithy.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
ShapeId.type
final case class Smithy(services: Map[String, Service] = ..., operations: Map[String, Operation] = ..., resources: Map[String, Resource] = ...)

Attributes

Companion
object
Source
Smithy.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Smithy

Attributes

Companion
class
Source
Smithy.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Smithy.type
object SmithyCodecs

Smithy IDL primitive codecs using RichTextCodec.

Smithy IDL primitive codecs using RichTextCodec.

These provide the building blocks for parsing Smithy IDL. The primitives demonstrate the enhanced | operator with Alternator support that unifies same-type alternatives without nested Either types.

Attributes

Source
SmithyCodecs.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final case class SmithyConfig(fieldNamesNormalization: NormalizeFields, validateBeforeGeneration: Boolean, generateCompanionObjects: Boolean, unwrapSingleMemberInputs: Boolean, generateEndpointsObject: Boolean, endpointsObjectName: String, includeDocumentation: Boolean, typeMapping: Map[String, String])

Configuration for Smithy code generation.

Configuration for Smithy code generation.

Value parameters

endpointsObjectName

Name of the generated endpoints object (default: "Endpoints").

fieldNamesNormalization

Controls normalization of field names from Smithy conventions (e.g., snake_case) to Scala conventions (camelCase). Original names are preserved via @fieldName annotations. Enabled by default.

generateCompanionObjects

If true, generates companion objects with Schema derivation for all case classes.

generateEndpointsObject

If true, generates a single Endpoints object containing all endpoint definitions. If false, generates separate files per operation.

includeDocumentation

If true, includes Smithy @documentation traits as Scaladoc comments in the generated code.

typeMapping

Custom mapping of Smithy shape names to Scala types. Allows overriding default type mappings for specific shapes. e.g., Map("UserId" -> "java.util.UUID")

unwrapSingleMemberInputs

If true, operations with single-member input structures will use the member type directly instead of the wrapper. e.g., GetUserInput { userId: String } -> endpoint takes String

validateBeforeGeneration

If true, validates the Smithy model before generating code. Validation errors will cause generation to fail with detailed messages.

Attributes

Companion
object
Source
SmithyConfig.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object SmithyConfig

Attributes

Companion
class
Source
SmithyConfig.scala
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Generates zio-http Endpoint definitions from Smithy models.

Generates zio-http Endpoint definitions from Smithy models.

This code generator reads a SmithyModel AST and produces:

  • Endpoint definitions for operations with @http traits
  • Case classes for structure shapes
  • Sealed traits for union shapes
  • Type aliases for simple shapes

Attributes

Companion
class
Source
SmithyEndpointGen.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final class SmithyEndpointGen(model: SmithyModel, config: SmithyConfig)

Attributes

Companion
object
Source
SmithyEndpointGen.scala
Supertypes
class Object
trait Matchable
class Any
final case class SmithyModel(version: String = ..., namespace: String = ..., metadata: Map[String, NodeValue] = ..., useStatements: List[ShapeId] = ..., shapes: Map[String, Shape] = ...)

Attributes

Source
Smithy.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object SmithyParser

Attributes

Source
Smithy.scala
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait SmithyTrait

Attributes

Companion
object
Source
Smithy.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Auth
class Default
object Error
class ErrorMessage
object EventStream
class Generic
class Http
object HttpBasicAuth
class HttpError
class HttpHeader
object HttpLabel
object HttpPayload
class HttpQuery
object Idempotent
class JsonName
class Length
class MediaType
class Pattern
class Range
object Readonly
object Required
object Streaming
Show all
object SmithyTrait

Attributes

Companion
trait
Source
Smithy.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Smithy Model Validation

Smithy Model Validation

Validates Smithy models according to the Smithy specification: https://smithy.io/2.0/spec/model-validation.html

Provides comprehensive validation with helpful error messages including:

  • Shape reference validation (undefined references)
  • HTTP trait validation (path parameters, methods, status codes)
  • Constraint trait validation (@length, @range, @pattern)
  • Structure validation (required members, duplicate members)
  • Operation validation (input/output/error shapes)
  • Service validation (referenced operations/resources exist)

Attributes

Source
SmithyValidation.scala
Supertypes
class Object
trait Matchable
class Any
Self type