logoalt Hacker News

jbmchuck • yesterday at 7:55 PM • 2 replies • view on HN

I believe AWS already autogenerates their API clients (e.g. boto3) based on some authoritative internal service api spec so I imagine that spec could be used upstream of this tool as well.


Replies

OptionOfT • yesterday at 8:35 PM

But their auto generated API clients don't have the invariant baked into them, which makes them very rough to use in say Rust.

They'll have something like this:

    MySchema:
      type: object
      properties:
        enum_member:   { enum: [foo, bar] }
        enum_member_2: { enum: [quz, qux] }
      if:   { properties: { enum_member: { const: bar } } }
      then: { required: [enum_member_2] }
Except, this is not defined in schemas, this is merely defined in prose around the documentation.

So your Rust API is full of Option, and it gets really annoying when you're testing things like say Bedrock, which takes 10 minutes, and then fails because what you submitted 10 minutes before doesn't match their schema.

I understand this can be fixed by reading the documentation in more detail, but it has gotten so verbose, and sometimes you just want to start something.

kellertk • yesterday at 8:49 PM

Not internal. Open sourced: https://github.com/aws/api-models-aws