Description
That's is related to #333
Given that all the major differences were removed in version 3, what is the reason to have remaining differences?
- type as array is just a syntax sugar for anyOf
- items - what is the reason to not support array syntax? APIs returning tuples and other heterogenous arrays are [regrettably] present. Why spec says items MUST be present? What's wrong with it not being present?
- patternProperties - together with propertyNames added in draft-06 it is needed to support hash-maps rather than records.
Additional fields in schema are not a problem, but it still beats me why the restrictions are needed - they create nothing but inconvenience. The argument that certain functionality of tools can't be supported for the full JSON schema spec (see #333 (comment) by @fehguy) is a very week one to not support full JSON schema in API spec.
Instead, OpenAPI can say that tools can choose to support full or restricted JSON-schema and make it clear in their documentation.
I understand that it means that the code in some language may not be possible to generate due to the restrictions of those languages. But it should be the problem constrained to the users of that particular language rather than to all users (using more dynamic/loosely typed languages). If I were to need to generate c++ code from OpenAPI spec, the generator would impose these restrictions and I would simplify the API definition file.
Having full JSON-schema spec allowed outweighs the benefit that ALL tools can always work with the schema - I believe it should be left to the developer's discretion to decide whether to use full/restricted schema rather than having "restricted" imposed by OpenAPI as the only possible option. This "nanny state" approach is very frustrating when using this spec.
It would also allow to simplify this spec by simply referencing JSON schema spec instead of redefining it here.