Skip to content

Commit 4c3c2cf

Browse files
committed
chore: update samples
1 parent bd53feb commit 4c3c2cf

55 files changed

Lines changed: 60 additions & 63 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

samples/client/petstore/elixir/lib/openapi_petstore/connection.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ defmodule OpenapiPetstore.Connection do
153153

154154
tesla_options = Application.get_env(:tesla, __MODULE__, [])
155155
middleware = Keyword.get(tesla_options, :middleware, [])
156-
json_engine = Keyword.get(tesla_options, :json, Jason)
156+
json_engine = Keyword.get(tesla_options, :json, JSON)
157157

158158
user_agent =
159159
Keyword.get(

samples/client/petstore/elixir/lib/openapi_petstore/deserializer.ex

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ defmodule OpenapiPetstore.Deserializer do
66
Helper functions for deserializing responses into models
77
"""
88

9-
@jason_decode_opts [keys: :strings]
10-
11-
def jason_decode(json) do
12-
Jason.decode(json, @jason_decode_opts)
9+
def json_decode(json) do
10+
JSON.decode(json)
1311
end
1412

15-
def jason_decode(json, module) do
13+
def json_decode(json, module) do
1614
json
17-
|> jason_decode()
15+
|> json_decode()
1816
|> case do
1917
{:ok, decoded} -> {:ok, to_struct(decoded, module)}
2018
{:error, _} = error -> error

samples/client/petstore/elixir/lib/openapi_petstore/model/_foo_get_default_response.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule OpenapiPetstore.Model.FooGetDefaultResponse do
66
77
"""
88

9-
@derive Jason.Encoder
9+
@derive JSON.Encoder
1010
defstruct [
1111
:string
1212
]

samples/client/petstore/elixir/lib/openapi_petstore/model/_special_model_name_.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule OpenapiPetstore.Model.SpecialModelName do
66
77
"""
88

9-
@derive Jason.Encoder
9+
@derive JSON.Encoder
1010
defstruct [
1111
:"$special[property.name]"
1212
]

samples/client/petstore/elixir/lib/openapi_petstore/model/additional_properties_class.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule OpenapiPetstore.Model.AdditionalPropertiesClass do
66
77
"""
88

9-
@derive Jason.Encoder
9+
@derive JSON.Encoder
1010
defstruct [
1111
:map_property,
1212
:map_of_map_property

samples/client/petstore/elixir/lib/openapi_petstore/model/all_of_with_single_ref.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule OpenapiPetstore.Model.AllOfWithSingleRef do
66
77
"""
88

9-
@derive Jason.Encoder
9+
@derive JSON.Encoder
1010
defstruct [
1111
:username,
1212
:SingleRefType

samples/client/petstore/elixir/lib/openapi_petstore/model/animal.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule OpenapiPetstore.Model.Animal do
66
77
"""
88

9-
@derive Jason.Encoder
9+
@derive JSON.Encoder
1010
defstruct [
1111
:className,
1212
:color

samples/client/petstore/elixir/lib/openapi_petstore/model/any.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule OpenapiPetstore.Model.Any do
66
77
"""
88

9-
@derive Jason.Encoder
9+
@derive JSON.Encoder
1010
defstruct [
1111
:"@type"
1212
]

samples/client/petstore/elixir/lib/openapi_petstore/model/api_response.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule OpenapiPetstore.Model.ApiResponse do
66
77
"""
88

9-
@derive Jason.Encoder
9+
@derive JSON.Encoder
1010
defstruct [
1111
:code,
1212
:type,

samples/client/petstore/elixir/lib/openapi_petstore/model/array_of_array_of_number_only.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule OpenapiPetstore.Model.ArrayOfArrayOfNumberOnly do
66
77
"""
88

9-
@derive Jason.Encoder
9+
@derive JSON.Encoder
1010
defstruct [
1111
:ArrayArrayNumber
1212
]

0 commit comments

Comments
 (0)