Validator doesn't report properties that are in the required list but not defined
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Reproduce the supplied OpenAPI 3.0.3 example and inspect how required properties are checked when they are absent from properties. Done means the validator reports every undefined required property, including problem-type, order-trees, and site-location, rather than only event-photo.
Written by the indexing model from the issue text.
Description
Following specification causes validator to report only the event-photo property
Required list has not defined properties: ['event-photo']
whereas I would expect similar messages for the problem-type, order-trees and site-location properties.
openapi: 3.0.3
info:
title: Protect Earth API
version: 0.3.0
paths:
/events:
get:
operationId: get-events
summary: Get Events
description: Get a list of all the events
tags:
- Event
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Generic_Problem'
/orders:
post:
operationId: post-orders
summary: Create Order
tags:
- Order
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Order'
responses:
'201':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Event'
components:
schemas:
Generic_Problem:
title: Problem
type: object
required:
- problem-type
- title
properties:
title:
type: string
status:
type: integer
Event:
title: Event
type: object
required:
- description
- event-photo
properties:
id:
type: string
summary:
type: string
description:
type: string
Order:
title: Order
type: object
required:
- site
- order-trees
properties:
id:
type: string
format: uuid
readOnly: true
site:
$ref: '#/components/schemas/Site'
Site:
title: Site
type: object
required:
- url
- site-location
properties:
id:
type: string
format: uuid
url:
type: string
format: url
- Dominant language
- Python
- Stars
- 409
- Forks
- 73
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from python-openapi/openapi-spec-validator
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
python-openapi/openapi-spec-validator#400 · 1 comment ·
-
kind/bug/confirmed
Difficulty 5/5 Over a week Newbie friendliness 25/100
python-openapi/openapi-spec-validator#373 · 1 comment ·
All issues in python-openapi/openapi-spec-validator
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
canonical/paas-charm#368 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
StevenBlack/hosts#3256 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
qualcomm/qai-appbuilder#275 ·