File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,11 @@ suite =
7171 decodedOperation
7272 |> Result . map ( OpenApi . Operation . security >> Maybe . map List . length)
7373 |> Expect . equal ( Ok ( Just 1 ))
74+ , test " security = []" <|
75+ \ () ->
76+ Json . Decode . decodeString OpenApi . Operation . decode securityIsEmptyArrayExample
77+ |> Result . map OpenApi . Operation . security
78+ |> Expect . equal ( Ok ( Just [] ))
7479 , describe " when 'security' is unspecified" <|
7580 [ test " it decodes to Nothing" <|
7681 \ () ->
@@ -163,6 +168,21 @@ example =
163168}"""
164169
165170
171+ securityIsEmptyArrayExample : String
172+ securityIsEmptyArrayExample =
173+ """ {
174+ "summary": "Updates a pet in the store with form data",
175+ "operationId": "updatePetWithForm",
176+ "security": [],
177+ "responses": {
178+ "200": {
179+ "description": "Pet updated.",
180+ "content": {}
181+ }
182+ }
183+ }"""
184+
185+
166186securityUnspecifiedExample : String
167187securityUnspecifiedExample =
168188 """ {
You can’t perform that action at this time.
0 commit comments