Describe the bug
oasdiff fails to load an OpenAPI 3.1 spec that uses unevaluatedProperties: false (boolean form). JSON Schema 2020-12 allows unevaluatedProperties to be either a boolean or a schema object, but the parser only accepts the schema object form.
To Reproduce
- Command:
oasdiff breaking base.yaml revision.yaml
- Spec (minimal reproduction):
openapi: 3.1.0
info:
title: Test
version: "1.0"
paths:
/test:
post:
requestBody:
content:
application/json:
schema:
type: object
additionalProperties: true
unevaluatedProperties: false
allOf:
- $ref: '#/components/schemas/Base'
responses:
'200':
description: OK
components:
schemas:
Base:
type: object
properties:
name:
type: string
- Output:
Error: failed to load base spec from "base.yaml": failed to unmarshal data: json error: invalid character 'o' looking for beginning of value, yaml error: error unmarshaling JSON: while decoding JSON: json: cannot unmarshal bool into field Schema.unevaluatedProperties of type openapi3.Schema
Expected behavior
unevaluatedProperties: false should be accepted as valid JSON Schema 2020-12. Per the spec, unevaluatedProperties can be a boolean or a schema object — false is equivalent to {"not": {}}.
Desktop (please complete the following information):
- OS: Linux (amd64, Drone CI container)
- oasdiff version: v2.2.0-openapi31.beta.3 (installed via
install.sh)
Additional context
The unevaluatedProperties boolean form is commonly used with allOf composition to prevent extra properties from slipping through unvalidated. Our OpenAPI 3.1 specs use this pattern in three places. This blocks us from testing the beta in CI.
Describe the bug
oasdiff fails to load an OpenAPI 3.1 spec that uses
unevaluatedProperties: false(boolean form). JSON Schema 2020-12 allowsunevaluatedPropertiesto be either a boolean or a schema object, but the parser only accepts the schema object form.To Reproduce
oasdiff breaking base.yaml revision.yamlExpected behavior
unevaluatedProperties: falseshould be accepted as valid JSON Schema 2020-12. Per the spec,unevaluatedPropertiescan be a boolean or a schema object —falseis equivalent to{"not": {}}.Desktop (please complete the following information):
install.sh)Additional context
The
unevaluatedPropertiesboolean form is commonly used withallOfcomposition to prevent extra properties from slipping through unvalidated. Our OpenAPI 3.1 specs use this pattern in three places. This blocks us from testing the beta in CI.