-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Description
In the definition of the License object of OpenAPI 3.1: the url and identifier properties are not marked as REQUIRED, so optional, and are defined as mutually exclusive.
The schema of the License object does not match with the specification making url or identifier required using the following construction at the root of of the object definition:
"oneOf": [
{"required": ["identifier"] },
{"required": ["url"]}
]If we compare both behaviors, that means the following (note that name is required):
| Specification | Schema |
|---|---|
|
|
The following document which is valid according to the specification is considered invalid when using the schema with the validation script or directly using it with ajv:
openapi: 3.1.0
info:
title: Dummy Bookshop
version: '1.0'
license:
name: Apache 2.0
paths: {}Before proposing a pull request to fix that issue, I would like to confirm that my interpretation of the specification is correct and to know if there are any recommendations to follow regarding when modifying the schema. Besides sticking to the JSON Schema version already used, there are maybe some features to not use to ensure compatibility? (I already found 4 different ways to say "url and identifier are optional and mutually exclusive", I'll put them in the discussion if fixing the schema is the solution).