swagger: '2.0'
info:
title: test
version: 0.0.0
paths: {}
definitions:
Model1:
type: int
A misspelled type value triggers an odd error
should be array
No "should be array" error.

I've opened a pull request (#1985) that will close this issue.
Here's what Swagger Editor reports with my changes:
Structural error at definitions.Model1.type
should be equal to one of the allowed values
allowedValues: array, boolean, integer, null, number, object, string
@shockey
allowedValues: ..., null, ...
type cannot be null in OAS.
@hkosova, do you have a citation for that?
I'm seeing that OAS 2.0 indicates Schema.type as "taken directly from the [JSON Schema draft-04] definition and follow the same specifications".
JSON Schema, in turn, defines seven primitive types, including null.
Clarification would be a big help here. Thanks!
@shockey In case of OAS2, it's not mentioned in the OpenAPI Specification explicitly, but @webron explained later that type: null is not supported
https://github.com/OAI/OpenAPI-Specification/issues/229#issuecomment-115379297
@webron commented on Jun 25, 2015:
null聽is not a valid type as it is not聽listed聽in the spec. ... There's no full compliance with JSON Schema, and while the spec defers to JSON Schema in some sections, it also imposes limitations on others. If you feel there needs to be extra clarification onnullnot being usable anywhere, I'll be happy to clarify it in the spec itself.
Interesting... The official OAS2 schema imports the Schema.type definition from the JSON Schema schema
"type": {
"$ref": "http://json-schema.org/draft-04/schema#/properties/type"
},
and the JSON Schema schema uses
"definitions": {
...
"simpleTypes": {
"enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
},
...
"type": {
"anyOf": [
{ "$ref": "#/definitions/simpleTypes" },
...
]
},
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 possible type values explicitly and there's no null type there.
@webron could you please clarify this?
null is not supported. The validation JSON Schema is not the source of truth. No null.
Most helpful comment
nullis not supported. The validation JSON Schema is not the source of truth. Nonull.