Hacker News new | ask | show | jobs
by jbmchuck 22 days ago
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.
2 comments

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.

The documentation is not detailed enough, you need to call the service for detailed correctness.
Not internal. Open sourced: https://github.com/aws/api-models-aws