Skip to content

Commit

Permalink
Update Schema.example/2 typespec to allow references
Browse files Browse the repository at this point in the history
  • Loading branch information
zorbash committed Jul 31, 2024
1 parent 19ffc49 commit 5ec452f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/open_api_spex/schema.ex
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ defmodule OpenApiSpex.Schema do
assert ...
end
"""
@spec example(schema :: Schema.t() | module) :: map | String.t() | number | boolean
@spec example(schema :: Schema.t() | module | Reference.t()) ::
map | String.t() | number | boolean
def example(%Schema{example: example} = schema) when not is_nil(example) do
schema.example
end
Expand Down

0 comments on commit 5ec452f

Please sign in to comment.