You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The OAS file below has a wrongly declared array in the response. It states type: array and last line, and is missing an items key. Spectral does not catch this as an error. However, deploying such OAS in Apigee will not work as Apigeee uses Swagger parser which catches this error.
openapi: 3.0.3info:
title: Wrong arraydescription: Wrong arrayversion: 1.0.0contact:
name: IDA Support Teamemail: ida_team@maersk.comurl: https://www.maersk.com/contactuslicense:
url: https://terms.maersk.com/api-license-termsname: Maersk 1.0servers:
- url: https://api-stage.netpaths:
/translatetoen:
post:
operationId: post-translation-requestdescription: Sent a text for translationrequestBody:
required: truecontent:
application/json:
schema:
type: objectproperties:
inputText:
type: stringrequired:
- inputTextresponses:
'200':
description: OKcontent:
application/json:
schema:
type: objectproperties:
highestPrecendenceLanguage:
type: stringtranslatedText:
type: stringallIdentifiedLanguages:
type: arrayitems:
type: array
To Reproduce
Use above OAS, create file oas-array-wrong.yaml
Run CLI spectral lint oas-array-wrong.yaml
Output is No results with a severity of 'error' found!
Expected behavior
The wrongly declared array should be treated as an error as you cannot have an array declared without stating what type the items are.
Screenshots
NA
Environment (remove any that are not applicable):
Library version: 6.11.0
OS: MacOS
Browser: NA
The text was updated successfully, but these errors were encountered:
Describe the bug
The OAS file below has a wrongly declared array in the response. It states
type: array
and last line, and is missing anitems
key. Spectral does not catch this as an error. However, deploying such OAS in Apigee will not work as Apigeee uses Swagger parser which catches this error.To Reproduce
oas-array-wrong.yaml
spectral lint oas-array-wrong.yaml
No results with a severity of 'error' found!
Expected behavior
The wrongly declared array should be treated as an error as you cannot have an array declared without stating what type the items are.
Screenshots
NA
Environment (remove any that are not applicable):
The text was updated successfully, but these errors were encountered: