rubyonjets / jets

Ruby on Jets
http://rubyonjets.com
MIT License
2.6k stars 181 forks source link

Generate schema for API Gateway responses #620

Closed esmarkowski closed 6 months ago

esmarkowski commented 2 years ago

Summary

Add Model definition to schema when building API Gateway templates. Optionally, allow JSON schema to be defined for each endpoint.

Motivation

When schema is defined in API Gateway it's possible to use the SDK to generate API clients directly from AWS. Without the schema the SDK is a useless pile of garbage.

Reference-level explanation

When using models in Jets, we should have enough information to create AWS::ApiGateway::Model. When building the CFN templates for API Gateway we could add the appropriate definition.

Type: AWS::ApiGateway::Model
Properties: 
  ContentType: String
  Description: String
  Name: String
  RestApiId: String
  Schema: Json

I'm going to take a stab at implementing this, but wanted to stub out a feature for reference.

tongueroo commented 6 months ago

Jets 6 works by deploying Rails now. So this would probably be implemented as a Rails engine or plugin now.

Related