Hi Francesco,
One thing worth noting, Phil Sturgeon and I have been working with the OpenAPI Technical Steering Committee to get them to converge with JSON Schema proper. The next release of OpenAPI will include experimental support for using any version of JSON Schema, as indicated by the "$schema" keyword. See
https://github.com/OAI/OpenAPI-Specification/issues/1532 for details.
Regarding types, JSON Schema is more flexible about types than many realize. If you make completely separate code paths for objects vs integers or whatever, you will find yourself in an awkward spot for schemas that work with multiple types simultaneously. For example, this is a valid schema:
{
"type": ["integer", "string"],
"minimum": 0,
"maximum": 255,
"minLength": 1,
"maxLength": 50
}
which validates any integer from 0 to 255 or any string of 1 to 50 characters. Implementations that assume a single type tend to have trouble with these schemas.
thanks,
-henry