mikunn / openapi-schema-to-json-schema

Converts OpenAPI Schema Object to JSON Schema
76 stars 6 forks source link

Allow `type: "null"` #16

Closed ehmicky closed 6 years ago

ehmicky commented 6 years ago

type: "null" is valid both in JSON schema v4 and in OpenAPI 2.0.

mikunn commented 6 years ago

type: "null" is not valid as it's not explicitly mentioned in the schema. It's a bit misleading.

ehmicky commented 6 years ago

Yes that's true. The current behavior of this library to convert nullable is actually what's expected according to OpenAPI 3.