@@ -8,8 +8,8 @@ defmodule Unit.EctoCommand.OpenApi.TypeTest do
88
99 describe "example_for/1 generates a valid example" do
1010 test "for arrays of enums" do
11- assert [ 1 , 2 ] == Type . example_for ( % Schema { type: :array , items: [ % { type: :integer , enum: [ 1 , 2 , 3 ] } ] } )
12- assert [ "a" , "b" ] == Type . example_for ( % Schema { type: :array , items: [ % { type: :string , enum: [ "a" , "b" , "c" ] } ] } )
11+ assert [ 1 , 2 ] == Type . example_for ( % Schema { type: :array , items: % { type: :integer , enum: [ 1 , 2 , 3 ] } } )
12+ assert [ "a" , "b" ] == Type . example_for ( % Schema { type: :array , items: % { type: :string , enum: [ "a" , "b" , "c" ] } } )
1313 end
1414
1515 test "for enums" do
@@ -138,16 +138,16 @@ defmodule Unit.EctoCommand.OpenApi.TypeTest do
138138 end
139139
140140 test "for arrays without inner type example and without default" do
141- assert [ ] == Type . example_for ( % Schema { type: :array , items: [ % Schema { type: :integer } ] } )
141+ assert [ ] == Type . example_for ( % Schema { type: :array , items: % Schema { type: :integer } } )
142142 end
143143
144144 test "for arrays with inner type example and without default" do
145- assert [ 1 ] == Type . example_for ( % Schema { type: :array , items: [ % Schema { type: :integer , example: 1 } ] } )
145+ assert [ 1 ] == Type . example_for ( % Schema { type: :array , items: % Schema { type: :integer , example: 1 } } )
146146 end
147147
148148 test "for arrays with inner type example and with default" do
149149 assert [ 1 , 2 , 3 ] ==
150- Type . example_for ( % Schema { type: :array , items: [ % Schema { type: :integer , example: 1 } ] , default: [ 1 , 2 , 3 ] } )
150+ Type . example_for ( % Schema { type: :array , items: % Schema { type: :integer , example: 1 } , default: [ 1 , 2 , 3 ] } )
151151 end
152152
153153 test "for object" do
@@ -159,7 +159,7 @@ defmodule Unit.EctoCommand.OpenApi.TypeTest do
159159 id: % OpenApiSpex.Schema { type: :string } ,
160160 name: % OpenApiSpex.Schema { type: :string } ,
161161 type: % OpenApiSpex.Schema { enum: [ "a" , "b" ] , type: :string , example: "a" } ,
162- tags: % OpenApiSpex.Schema { type: :array , items: [ % OpenApiSpex.Schema { type: :string } ] , default: [ ] } ,
162+ tags: % OpenApiSpex.Schema { type: :array , items: % OpenApiSpex.Schema { type: :string } , default: [ ] } ,
163163 non_required_id: % OpenApiSpex.Schema { type: :string }
164164 }
165165 }
0 commit comments