aws-beam / aws-elixir

AWS clients for Elixir
Apache License 2.0
555 stars 132 forks source link

New spec is specific to keys in requests being strings #198

Open grant-zukowski-xumo opened 4 months ago

grant-zukowski-xumo commented 4 months ago

For example:

https://github.com/aws-beam/aws-elixir/blob/master/lib/aws/generated/media_package_v2.ex#L592

When building request input within Elixir, most of our codebase does it using atoms as strings:

input = %{Foo: bar}

The new spec demands that

@type create_channel_request() :: %{String.t() => any()}

@typedoc """

Example:

  filter_configuration() :: %{
    "End" => [non_neg_integer()],
    "ManifestFilter" => [String.t()],
    "Start" => [non_neg_integer()],
    "TimeDelaySeconds" => [integer()]
  }

"""

Is it possible to have the generator accept atoms as keys as well?

onno-vos-dev commented 1 month ago

@grant-zukowski-xumo Sorry to ignore this issue for so long 😢 I'll have a look at the codegen this weekend and see what can be done 👍 I guess this works with atoms due to to_string/1 usage in xml.ex and util.ex in which case it very much makes sense to align the spec with it 👍