Request validation does not work properly in case request schema is an object "derived" from other object using allOf
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
No implementation files or tests are named. Start by reproducing the OpenAPI request-validation case with the shown allOf schema, then locate the validator and its existing schema-validation tests; done means unknown option_3 and capability_3 properties are rejected while inherited and declared properties remain valid.
Written by the indexing model from the issue text.
Description
Hi. I am trying to validate a request which is an object "derived" from other object using allOf
components:
schemas:
Base:
type: object
properties:
ctime:
type: integer
ExtendedResource:
allOf:
- $ref: '#/components/schemas/Base'
- type: object
properties:
name:
type: string
options:
type: object
properties:
option_1:
type: string
option_2:
type: string
capabilities:
type: object
properties:
capability_1:
type: string
capability_2:
type: string
Currently validator does not raise any exceptions in case of the following request body:
{'name': 'ext_res',
'options': {'option_1': 'a', 'option_3': 'b'},
'capabilities': {'capability_1': 'c', 'capability_3': '3'}}
Expecting that options.option_3 or capabilities.capability_3 are rejected.
Many Thanks!
- Dominant language
- Python
- Stars
- 368
- Forks
- 140
- 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-core
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
python-openapi/openapi-core#1188 · 2 comments ·
-
kind/bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
python-openapi/openapi-core#1225 · 2 comments ·
-
kind/bug
Difficulty 3/5 1-2 days Newbie friendliness 76/100
python-openapi/openapi-core#1212 ·
-
[Bug]: Query parameter validation fails to match empty string when listed as a valid enum value Openkind/bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
python-openapi/openapi-core#1210 ·
-
kind/bug kind/bug/confirmed
Difficulty 3/5 1-2 days Newbie friendliness 58/100
python-openapi/openapi-core#1180 · 3 comments ·
All issues in python-openapi/openapi-core
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
learningequality/ricecooker#747 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
run-llama/llama_index#23199 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
KhronosGroup/glTF-Blender-IO#2769 ·