Skip to content
Switch branches/tags


Failed to load latest commit information.
Latest commit message
Commit time

Smithy Ruby

Smithy SDK code generators for Ruby and SDK core libraries.

WARNING: All interfaces are subject to change.


Generating an SDK for a Rails JSON API

  1. Create a new gradle project
  2. Add smithy to the plugins list (Note, you can find the latest plugin version at:
plugins {
  1. Add the smithy-ruby-rails-codegen as a dependency:
dependencies {
  1. Add your smithy model. under <project_root>/model.

  2. Create a smithy-build.json file that defines how Smithy should build your SDK. It must define a section under plugins for ruby-codegen. For reference see: rails json test smithy-build.json.

  3. Execute the gradle build task. This will generate the SDK from your model using the settings from your smithy-build.json file.
    The generated SDK will be available under the build/smithyprojections/<project_name>//ruby-codegen folder.


This project is licensed under the Apache-2.0 License.


See CONTRIBUTING for more information.


Design Documentation (WIP)


Many Gradle issues can be fixed by stopping the daemon by running ./gradlew --stop


Running codegen integration tests

Codegen integration tests are written as ruby rspec tests (under smithy-ruby-codegentest/integration-specs). The gradle :smithy-ruby-codegen-test:build target will create a sample_service_real directory and copy the specs into it. From that directory, run rspec (assuming you have required dependencies installed).

These tests run against the generated test sdk defined by the high-score model in the smithy-ruby-codegen-test project.

Running seahorse unit tests.

Seahorse has a full suite of rspec tests which can be run from the seahorse directory with: rspec.

Manual Testing

The sample-service directory defines a rails service that can be run with rails s. You can then test manually by adding seahorse and the generated sdk client to your library path with:

irb -I 'seahorse/lib' -I 'sample_service/lib'

And test with:

require 'sample_service'

c = '')
c.get_high_score(id: '1')