-
Notifications
You must be signed in to change notification settings - Fork 97
Closed
Labels
bugSomething isn't workingSomething isn't workingneeds investigationWork is needed to figure out the root cause of the problem.Work is needed to figure out the root cause of the problem.
Description
First of all, thanks for the efforts made on php-openapi. :)
Take the following simple (minimal reproducable) example:
openapi: 3.0.3
info:
title: Test
version: 0.1.0
paths:
/test:
get:
responses:
"200":
description: Test
components:
schemas:
answer:
type: object
properties:
id:
type: integerWe all know, this is perfectly valid. But for some odd reason, I thought the summary property is allowed in an Schema Object (i.e. id in this case), so I wrote the above example this way:
# ...Stripped...
id:
type: integer
summary: Unique answer IDAs this becomes invalid (description must be used instead), php-openapi must handle this and print a good error message. Let's see:
OpenAPI v3.0 schema violations:
- [components.schemas.answer.properties.id.$ref] The property $ref is required
- [components.schemas.answer.properties.id] The property summary is not defined and the definition does not
allow additional properties
Ignoring the second error message, the first one is really confusing, and is completely wrong in this case. This can be daunting if you run php-openapi on a big erroneous document and getting bunches of these errors.
cebe
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingneeds investigationWork is needed to figure out the root cause of the problem.Work is needed to figure out the root cause of the problem.