Smithy IDL

repository·main·Indexed 23 days ago

https://github.com/smithy-lang/smithy

An Interface Definition Language (IDL) for defining services, resources, and operations to generate clients, services, and documentation for various protocols. The ecosystem includes the Smithy CLI for building models, SmithyBuild for model validation and projections, Smithy Codegen for artifact generation, and Smithy Diff for detecting backward-incompatible changes between models.

Tokens
265.4K
Snippets
679
Records
1.1K
Agent score
81%

What's inside Smithy

  1. Overview of Smithy Linters

    main
    Smithy Linters allow you to define and enforce custom linting rules directly within your Smithy models. These linters are declared in the metadata section of a model, enabling customizable validation and style enforcement that is tied to the model definition itself.
  2. What is Smithy and how is it used

    main
    Smithy is an interface definition language (IDL) and a set of tools designed to build clients, servers, and other artifacts through model transformations. Developers use Smithy models to define service interfaces and data structures, which can then be transformed into specific implementation code or documentation.
  3. Overview of Smithy JMESPath

    main

    Smithy JMESPath is a Java-based implementation of the JMESPath parser.

    Key Characteristics:

    • Purpose: It is designed to parse JMESPath expressions, perform static analysis, and provide an Abstract Syntax Tree (AST) suitable for code generation.
    • Limitations: It is not intended for runtime use, does not include a JMESPath interpreter, and does not implement JMESPath functions.
    • Use Case: Use this library if you are building tools that need to analyze JMESPath expressions or generate code (such as serializers or query engines) based on a JMESPath AST.
  4. Overview of SmithyBuild

    main

    SmithyBuild is a library designed for managing Smithy models during the build process. It provides capabilities for:

    • Model Validation: Ensuring Smithy models adhere to the specification.
    • Model Projections: Creating filtered subsets or projections of a model.
    • Artifact Generation: Generating build artifacts derived from the Smithy models.
  5. What is Smithy?

    main
    Smithy is an interface definition language (IDL) and a set of tools used to build clients and servers in multiple languages. A Smithy model defines a service as a collection of resources, operations, and shapes. These models can be used to generate API documentation, client/server code, test automation, and example code.
  6. Core capabilities of SmithyModel

    main

    The SmithyModel module is the central component for working with Smithy models. It provides the core implementation for the following lifecycle operations:

    • Loading: Reading Smithy models from various sources.
    • Validating: Ensuring a model adheres to the Smithy specification.
    • Traversing: Navigating the structure of the model (e.g., visiting shapes, members, or traits).
    • Mutating: Programmatically modifying the contents of a model.
    • Serializing: Converting a model back into a serialized format.
  7. Use Smithy MQTT traits for MQTT binding

    main
    The smithy-mqtt-traits module provides the implementation of MQTT binding traits for Smithy. These traits allow you to define MQTT-specific metadata and constraints within your Smithy models, enabling tools to understand how Smithy shapes map to MQTT topics, payloads, and other MQTT-specific semantics.
  8. Generate clients and servers from Smithy models

    main

    Smithy models can be used to automate the generation of clients and servers across various programming languages. The generated code handles low-level implementation details such as endpoints, serialization, and deserialization, ensuring consistency between the model and the implementation.

    To find available generators for specific languages, refer to the Awesome Smithy repository.

  9. Use Smithy AWS core traits for AWS service modeling

    main
    The smithy-aws-traits package provides a collection of traits and validators specifically designed for modeling AWS services. These traits allow you to apply AWS-specific semantics, constraints, and validation rules to your Smithy models, ensuring they align with the standards used across most AWS services. For a deep dive into the formal semantics of how these traits are applied, refer to the Smithy specification.
  10. What is Smithy IDL

    main

    Smithy is an Interface Definition Language (IDL) used to define and generate clients, services, and documentation for any protocol. A Smithy model defines a service as a collection of resources, operations, and shapes.

    $version: "2"
    
    namespace example.weather
    
    service Weather {
        version: "2006-03-01"
        resources: [City]
        operations: [GetCurrentTime]
    }
    
    resource City {
        identifiers: { cityId: CityId }
        read: GetCity
        list: ListCities
        resources: [Forecast]
    }