drewble ba5ecbccde
Improved Elixir Atom Generation (#20229)
* Update ElixirClientCodegen.java

* Refine the regular expression for atoms

The original regex incorrectly matched `@atom` (unquoted atoms
cannot begin with @). However, through testing with `iex`, it also turns out that the atom
`:@` is legal.

The following atoms will now be quoted that would have been
incorrectly not quoted:

- `:@type`

* Add model to petstore client to test new atom creation regex pattern
2024-12-06 14:26:39 +08:00

15 lines
376 B
Elixir

defmodule AnyTest do
use ExUnit.Case, async: true
alias OpenapiPetstore.Model.Any, as: Model
test "decode all properties (not nil)" do
assert %Model{
"@type": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
|> Model.decode() ==
%Model{
"@type": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
end
end