From 6930433def83168e95dce7f333bbf22d1e8ac6c6 Mon Sep 17 00:00:00 2001 From: Michael Ramstein <633688+mrmstn@users.noreply.github.com> Date: Thu, 29 Nov 2018 08:58:32 +0100 Subject: [PATCH] [elixir] Typespec - allow null on optional struct-attributes (#1514) * Typespec - allow null on optional parameters * Run Petstore for elixir * considers 'nullable' in model template, fixes 'isRequired' --- .../src/main/resources/elixir/model.mustache | 2 +- .../model/additional_properties_class.ex | 4 ++-- .../lib/openapi_petstore/model/animal.ex | 2 +- .../lib/openapi_petstore/model/api_response.ex | 6 +++--- .../model/array_of_array_of_number_only.ex | 2 +- .../model/array_of_number_only.ex | 2 +- .../lib/openapi_petstore/model/array_test.ex | 6 +++--- .../openapi_petstore/model/capitalization.ex | 12 ++++++------ .../elixir/lib/openapi_petstore/model/cat.ex | 4 ++-- .../lib/openapi_petstore/model/category.ex | 2 +- .../lib/openapi_petstore/model/class_model.ex | 2 +- .../lib/openapi_petstore/model/client.ex | 2 +- .../elixir/lib/openapi_petstore/model/dog.ex | 4 ++-- .../lib/openapi_petstore/model/enum_arrays.ex | 4 ++-- .../lib/openapi_petstore/model/enum_test.ex | 8 ++++---- .../model/file_schema_test_class.ex | 4 ++-- .../lib/openapi_petstore/model/format_test.ex | 18 +++++++++--------- .../model/has_only_read_only.ex | 4 ++-- .../lib/openapi_petstore/model/map_test.ex | 8 ++++---- ...operties_and_additional_properties_class.ex | 6 +++--- .../model/model_200_response.ex | 4 ++-- .../elixir/lib/openapi_petstore/model/name.ex | 6 +++--- .../lib/openapi_petstore/model/number_only.ex | 2 +- .../elixir/lib/openapi_petstore/model/order.ex | 12 ++++++------ .../openapi_petstore/model/outer_composite.ex | 6 +++--- .../elixir/lib/openapi_petstore/model/pet.ex | 8 ++++---- .../openapi_petstore/model/read_only_first.ex | 4 ++-- .../lib/openapi_petstore/model/return.ex | 2 +- .../model/special_model_name.ex | 2 +- .../elixir/lib/openapi_petstore/model/tag.ex | 4 ++-- .../elixir/lib/openapi_petstore/model/user.ex | 16 ++++++++-------- 31 files changed, 84 insertions(+), 84 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/elixir/model.mustache b/modules/openapi-generator/src/main/resources/elixir/model.mustache index 20bcfbdce9c..98c01f9096d 100644 --- a/modules/openapi-generator/src/main/resources/elixir/model.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/model.mustache @@ -11,7 +11,7 @@ ] @type t :: %__MODULE__{ - {{#vars}}:"{{baseName}}" => {{{dataType}}}{{#hasMore}}, + {{#vars}}:"{{baseName}}" => {{{datatype}}}{{#isNullable}} | nil{{/isNullable}}{{^isNullable}}{{^required}} | nil{{/required}}{{/isNullable}}{{#hasMore}}, {{/hasMore}}{{/vars}} } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_class.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_class.ex index 0921cc583f8..837bf62a7ce 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_class.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_class.ex @@ -14,8 +14,8 @@ defmodule OpenapiPetstore.Model.AdditionalPropertiesClass do ] @type t :: %__MODULE__{ - :"map_property" => %{optional(String.t) => String.t}, - :"map_of_map_property" => %{optional(String.t) => %{optional(String.t) => String.t}} + :"map_property" => %{optional(String.t) => String.t} | nil, + :"map_of_map_property" => %{optional(String.t) => %{optional(String.t) => String.t}} | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/animal.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/animal.ex index 27e45bc5ead..deb93a04d0e 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/animal.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/animal.ex @@ -15,7 +15,7 @@ defmodule OpenapiPetstore.Model.Animal do @type t :: %__MODULE__{ :"className" => String.t, - :"color" => String.t + :"color" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/api_response.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/api_response.ex index 27a6813ff20..7dc34e32ad7 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/api_response.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/api_response.ex @@ -15,9 +15,9 @@ defmodule OpenapiPetstore.Model.ApiResponse do ] @type t :: %__MODULE__{ - :"code" => integer(), - :"type" => String.t, - :"message" => String.t + :"code" => integer() | nil, + :"type" => String.t | nil, + :"message" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_array_of_number_only.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_array_of_number_only.ex index 1ee202f602f..e126f51109c 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_array_of_number_only.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_array_of_number_only.ex @@ -13,7 +13,7 @@ defmodule OpenapiPetstore.Model.ArrayOfArrayOfNumberOnly do ] @type t :: %__MODULE__{ - :"ArrayArrayNumber" => [[float()]] + :"ArrayArrayNumber" => [[float()]] | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_number_only.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_number_only.ex index 0be9ae36939..2e8e5355248 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_number_only.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_number_only.ex @@ -13,7 +13,7 @@ defmodule OpenapiPetstore.Model.ArrayOfNumberOnly do ] @type t :: %__MODULE__{ - :"ArrayNumber" => [float()] + :"ArrayNumber" => [float()] | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_test.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_test.ex index d725eb77a19..fbed2547c5e 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/array_test.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/array_test.ex @@ -15,9 +15,9 @@ defmodule OpenapiPetstore.Model.ArrayTest do ] @type t :: %__MODULE__{ - :"array_of_string" => [String.t], - :"array_array_of_integer" => [[integer()]], - :"array_array_of_model" => [[ReadOnlyFirst]] + :"array_of_string" => [String.t] | nil, + :"array_array_of_integer" => [[integer()]] | nil, + :"array_array_of_model" => [[ReadOnlyFirst]] | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/capitalization.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/capitalization.ex index 7b303458fd3..e9627cf3341 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/capitalization.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/capitalization.ex @@ -18,12 +18,12 @@ defmodule OpenapiPetstore.Model.Capitalization do ] @type t :: %__MODULE__{ - :"smallCamel" => String.t, - :"CapitalCamel" => String.t, - :"small_Snake" => String.t, - :"Capital_Snake" => String.t, - :"SCA_ETH_Flow_Points" => String.t, - :"ATT_NAME" => String.t + :"smallCamel" => String.t | nil, + :"CapitalCamel" => String.t | nil, + :"small_Snake" => String.t | nil, + :"Capital_Snake" => String.t | nil, + :"SCA_ETH_Flow_Points" => String.t | nil, + :"ATT_NAME" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/cat.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/cat.ex index ab4e49e6d80..416bb0a73eb 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/cat.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/cat.ex @@ -16,8 +16,8 @@ defmodule OpenapiPetstore.Model.Cat do @type t :: %__MODULE__{ :"className" => String.t, - :"color" => String.t, - :"declawed" => boolean() + :"color" => String.t | nil, + :"declawed" => boolean() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/category.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/category.ex index 9b1c71be1b6..2d1c853ab49 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/category.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/category.ex @@ -14,7 +14,7 @@ defmodule OpenapiPetstore.Model.Category do ] @type t :: %__MODULE__{ - :"id" => integer(), + :"id" => integer() | nil, :"name" => String.t } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/class_model.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/class_model.ex index 9b26c5e3e7b..e204556d8b7 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/class_model.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/class_model.ex @@ -13,7 +13,7 @@ defmodule OpenapiPetstore.Model.ClassModel do ] @type t :: %__MODULE__{ - :"_class" => String.t + :"_class" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/client.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/client.ex index d02cc3e7c06..cd5a452028b 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/client.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/client.ex @@ -13,7 +13,7 @@ defmodule OpenapiPetstore.Model.Client do ] @type t :: %__MODULE__{ - :"client" => String.t + :"client" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/dog.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/dog.ex index 509f7b8f154..f4a7eae34ab 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/dog.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/dog.ex @@ -16,8 +16,8 @@ defmodule OpenapiPetstore.Model.Dog do @type t :: %__MODULE__{ :"className" => String.t, - :"color" => String.t, - :"breed" => String.t + :"color" => String.t | nil, + :"breed" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_arrays.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_arrays.ex index 367ab0f6f28..d8f98a028a7 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_arrays.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_arrays.ex @@ -14,8 +14,8 @@ defmodule OpenapiPetstore.Model.EnumArrays do ] @type t :: %__MODULE__{ - :"just_symbol" => String.t, - :"array_enum" => [String.t] + :"just_symbol" => String.t | nil, + :"array_enum" => [String.t] | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_test.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_test.ex index abc41ec5a80..11e81c98a77 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_test.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/enum_test.ex @@ -17,11 +17,11 @@ defmodule OpenapiPetstore.Model.EnumTest do ] @type t :: %__MODULE__{ - :"enum_string" => String.t, + :"enum_string" => String.t | nil, :"enum_string_required" => String.t, - :"enum_integer" => integer(), - :"enum_number" => float(), - :"outerEnum" => OuterEnum + :"enum_integer" => integer() | nil, + :"enum_number" => float() | nil, + :"outerEnum" => OuterEnum | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/file_schema_test_class.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/file_schema_test_class.ex index 3a52359a5f0..2c5031ca919 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/file_schema_test_class.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/file_schema_test_class.ex @@ -14,8 +14,8 @@ defmodule OpenapiPetstore.Model.FileSchemaTestClass do ] @type t :: %__MODULE__{ - :"file" => File, - :"files" => [File] + :"file" => File | nil, + :"files" => [File] | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/format_test.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/format_test.ex index 144a12a254d..869d7aa4192 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/format_test.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/format_test.ex @@ -25,18 +25,18 @@ defmodule OpenapiPetstore.Model.FormatTest do ] @type t :: %__MODULE__{ - :"integer" => integer(), - :"int32" => integer(), - :"int64" => integer(), + :"integer" => integer() | nil, + :"int32" => integer() | nil, + :"int64" => integer() | nil, :"number" => float(), - :"float" => float(), - :"double" => float(), - :"string" => String.t, + :"float" => float() | nil, + :"double" => float() | nil, + :"string" => String.t | nil, :"byte" => binary(), - :"binary" => String.t, + :"binary" => String.t | nil, :"date" => Date.t, - :"dateTime" => DateTime.t, - :"uuid" => String.t, + :"dateTime" => DateTime.t | nil, + :"uuid" => String.t | nil, :"password" => String.t } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/has_only_read_only.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/has_only_read_only.ex index aea5065c090..1a1fa302edb 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/has_only_read_only.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/has_only_read_only.ex @@ -14,8 +14,8 @@ defmodule OpenapiPetstore.Model.HasOnlyReadOnly do ] @type t :: %__MODULE__{ - :"bar" => String.t, - :"foo" => String.t + :"bar" => String.t | nil, + :"foo" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/map_test.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/map_test.ex index d3870aa0075..726814dd817 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/map_test.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/map_test.ex @@ -16,10 +16,10 @@ defmodule OpenapiPetstore.Model.MapTest do ] @type t :: %__MODULE__{ - :"map_map_of_string" => %{optional(String.t) => %{optional(String.t) => String.t}}, - :"map_of_enum_string" => %{optional(String.t) => String.t}, - :"direct_map" => %{optional(String.t) => boolean()}, - :"indirect_map" => %{optional(String.t) => boolean()} + :"map_map_of_string" => %{optional(String.t) => %{optional(String.t) => String.t}} | nil, + :"map_of_enum_string" => %{optional(String.t) => String.t} | nil, + :"direct_map" => %{optional(String.t) => boolean()} | nil, + :"indirect_map" => %{optional(String.t) => boolean()} | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/mixed_properties_and_additional_properties_class.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/mixed_properties_and_additional_properties_class.ex index 014b696ff6d..3603ec4f6bb 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/mixed_properties_and_additional_properties_class.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/mixed_properties_and_additional_properties_class.ex @@ -15,9 +15,9 @@ defmodule OpenapiPetstore.Model.MixedPropertiesAndAdditionalPropertiesClass do ] @type t :: %__MODULE__{ - :"uuid" => String.t, - :"dateTime" => DateTime.t, - :"map" => %{optional(String.t) => Animal} + :"uuid" => String.t | nil, + :"dateTime" => DateTime.t | nil, + :"map" => %{optional(String.t) => Animal} | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/model_200_response.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/model_200_response.ex index e3764d66ea2..2bc6d152906 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/model_200_response.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/model_200_response.ex @@ -14,8 +14,8 @@ defmodule OpenapiPetstore.Model.Model200Response do ] @type t :: %__MODULE__{ - :"name" => integer(), - :"class" => String.t + :"name" => integer() | nil, + :"class" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/name.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/name.ex index 1b4c97a8060..cd2fdce24d0 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/name.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/name.ex @@ -17,9 +17,9 @@ defmodule OpenapiPetstore.Model.Name do @type t :: %__MODULE__{ :"name" => integer(), - :"snake_case" => integer(), - :"property" => String.t, - :"123Number" => integer() + :"snake_case" => integer() | nil, + :"property" => String.t | nil, + :"123Number" => integer() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/number_only.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/number_only.ex index 84e1ae57760..825553cf9f3 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/number_only.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/number_only.ex @@ -13,7 +13,7 @@ defmodule OpenapiPetstore.Model.NumberOnly do ] @type t :: %__MODULE__{ - :"JustNumber" => float() + :"JustNumber" => float() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/order.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/order.ex index 3f6f5c81314..936a7039dce 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/order.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/order.ex @@ -18,12 +18,12 @@ defmodule OpenapiPetstore.Model.Order do ] @type t :: %__MODULE__{ - :"id" => integer(), - :"petId" => integer(), - :"quantity" => integer(), - :"shipDate" => DateTime.t, - :"status" => String.t, - :"complete" => boolean() + :"id" => integer() | nil, + :"petId" => integer() | nil, + :"quantity" => integer() | nil, + :"shipDate" => DateTime.t | nil, + :"status" => String.t | nil, + :"complete" => boolean() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/outer_composite.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/outer_composite.ex index 00c4df9228e..04143a20a57 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/outer_composite.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/outer_composite.ex @@ -15,9 +15,9 @@ defmodule OpenapiPetstore.Model.OuterComposite do ] @type t :: %__MODULE__{ - :"my_number" => float(), - :"my_string" => String.t, - :"my_boolean" => boolean() + :"my_number" => float() | nil, + :"my_string" => String.t | nil, + :"my_boolean" => boolean() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/pet.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/pet.ex index 8f2802d5953..4fdcdc95a8e 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/pet.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/pet.ex @@ -18,12 +18,12 @@ defmodule OpenapiPetstore.Model.Pet do ] @type t :: %__MODULE__{ - :"id" => integer(), - :"category" => Category, + :"id" => integer() | nil, + :"category" => Category | nil, :"name" => String.t, :"photoUrls" => [String.t], - :"tags" => [Tag], - :"status" => String.t + :"tags" => [Tag] | nil, + :"status" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/read_only_first.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/read_only_first.ex index 942bb6045e8..bfd2dda2072 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/read_only_first.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/read_only_first.ex @@ -14,8 +14,8 @@ defmodule OpenapiPetstore.Model.ReadOnlyFirst do ] @type t :: %__MODULE__{ - :"bar" => String.t, - :"baz" => String.t + :"bar" => String.t | nil, + :"baz" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/return.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/return.ex index ad2765dbd12..8a2102c5989 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/return.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/return.ex @@ -13,7 +13,7 @@ defmodule OpenapiPetstore.Model.Return do ] @type t :: %__MODULE__{ - :"return" => integer() + :"return" => integer() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/special_model_name.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/special_model_name.ex index e4bed9810c6..429129b42a0 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/special_model_name.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/special_model_name.ex @@ -13,7 +13,7 @@ defmodule OpenapiPetstore.Model.SpecialModelName do ] @type t :: %__MODULE__{ - :"$special[property.name]" => integer() + :"$special[property.name]" => integer() | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/tag.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/tag.ex index 720f19b309b..5dd3bac7502 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/tag.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/tag.ex @@ -14,8 +14,8 @@ defmodule OpenapiPetstore.Model.Tag do ] @type t :: %__MODULE__{ - :"id" => integer(), - :"name" => String.t + :"id" => integer() | nil, + :"name" => String.t | nil } end diff --git a/samples/client/petstore/elixir/lib/openapi_petstore/model/user.ex b/samples/client/petstore/elixir/lib/openapi_petstore/model/user.ex index 17cfecea713..faaf4ab9a96 100644 --- a/samples/client/petstore/elixir/lib/openapi_petstore/model/user.ex +++ b/samples/client/petstore/elixir/lib/openapi_petstore/model/user.ex @@ -20,14 +20,14 @@ defmodule OpenapiPetstore.Model.User do ] @type t :: %__MODULE__{ - :"id" => integer(), - :"username" => String.t, - :"firstName" => String.t, - :"lastName" => String.t, - :"email" => String.t, - :"password" => String.t, - :"phone" => String.t, - :"userStatus" => integer() + :"id" => integer() | nil, + :"username" => String.t | nil, + :"firstName" => String.t | nil, + :"lastName" => String.t | nil, + :"email" => String.t | nil, + :"password" => String.t | nil, + :"phone" => String.t | nil, + :"userStatus" => integer() | nil } end