"should be an array" error caused by misspelled "type" values
See original GitHub issueQ&A (please complete the following information)
- OS: Windows 7
- Browser: Chrome 67
- Method of installation: http://editor.swagger.io
- Swagger-Editor version: 3.6.3
- Swagger/OpenAPI version: 2.0
Example Swagger/OpenAPI definition:
swagger: '2.0'
info:
title: test
version: 0.0.0
paths: {}
definitions:
Model1:
type: int
Describe the bug you’re encountering
A misspelled type
value triggers an odd error
should be array
Expected behavior
No “should be array” error.
Screenshots
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
I keep getting error on must be array type but it resolved to string
I got some errors on length cannot be resolved or not part of a field the type of the expression must be an...
Read more >Error Comprehension and Debugging - Pre-Lab Content
Another common indexing error occurs when you attempt to use an index that is larger than the number of elements in the array....
Read more >How to Prevent the Error: Cannot Read Property '0' of Undefined
If a property of an object is an array, it's possible to accidentally misspell the key or try to access the array through...
Read more >Syntax Error - an overview | ScienceDirect Topics
6.5. Syntax errors are mistakes in using the language. Examples of syntax errors are missing a comma or a quotation mark, or misspelling...
Read more >Common error messages in NCL
The type of missing value could not be converted to type of variable. Sample code that causes the error: x = (/1,2,3,4,5,-999/) ;...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
null
is not supported. The validation JSON Schema is not the source of truth. Nonull
.Interesting… The official OAS2 schema imports the
Schema.type
definition from the JSON Schema schemaand the JSON Schema schema uses
meaning the OAS2 schema does indeed (sort of) allow
type: null
.Which might be an oversight of the part of OAS spec authors because other places in the OAS2 schema (e.g.
queryParameterSubSchema.type
) list the possibletype
values explicitly and there’s nonull
type there.@webron could you please clarify this?