spec-first/connexion

Add support for `x-oas-draft-alternateSchemas`

開放

#861 建立於 2019年1月29日

 (0 則留言) (2 個反應) (0 位負責人)Python (738 個分叉)batch import
enhancementhelp wanted

倉庫指標

星標
 (4,346 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

OpenAPI lags behind JSON Schema, which means OpenAPI APIs do not benefit from the latest fixes and improvements to the latter.

For example:

  1. JSON Schema Draft 4's patternProperties is not supported in OpenAPI, even though the latter is based on Draft 5 (OAI/OpenAPI-Specification#687).
  2. additionalProperties: false is not compatible with OpenAPI's inheritance model using allOf [1]. This is blocking for strict validation of JSON request bodies that depend on inheritance (#837).
  3. Similar issues exist when combining nullable, readOnly, and writeOnly with OpenAPI's inheritance model.

It would be nice if we could already use x-oas-draft-alternateSchemas to specify other schemas to address some of these issues, until alternativeSchema is available in OpenAPI 3.1 (https://github.com/OAI/OpenAPI-Specification/pull/1736).

Related issue: https://github.com/Rebilly/ReDoc/issues/482

[1] https://stackoverflow.com/questions/22689900/json-schema-allof-with-additionalproperties

貢獻者指南