No support for specifying any type
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 30/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- À l'abandon
- Stack technique
- openapi, python
- Domaine
- api, backend-api-design
Piste de recherche
Start with openapi_core/unmarshalling/schemas/unmarshallers.py and factories.py, following the traceback through oneOf handling and array items creation. Reproduce the provided schema with an array whose items are {} and verify that validation succeeds without the "schema not type of Schema" error.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Swagger spec:
Query:
type: object
required:
- select
properties:
select:
type: array
items:
type: string
where:
type: array
items:
type: object
required:
- name
- operator
- value
properties:
name:
type: string
operator:
type: string
value:
oneOf:
- type: string
- type: number
- type: boolean
- type: array
items: {}
It failed to validate array type for value property (other types are validated fine, when array is removed).
Using lib in combination with Falcon, error is:
Traceback (most recent call last):
File "D:\.venv\lib\site-packages\falcon\api.py", line 242, in __call__
process_resource(req, resp, resource, params)
File "D:\.venv\lib\site-packages\my_lib\falcon_svc.py", line 391, in process_resource
result = validator.validate(openapi_request)
File "D:\.venv\lib\site-packages\openapi_core\validation\request\validators.py", line 48, in validate
body, body_errors = self._get_body(request, operation)
File "D:\.venv\lib\site-packages\openapi_core\validation\request\validators.py", line 174, in _get_body
body = self._unmarshal(media_type, casted)
File "D:\.venv\lib\site-packages\openapi_core\validation\request\validators.py", line 221, in _unmarshal
param_or_media_type, value, context=UnmarshalContext.REQUEST,
File "D:\.venv\lib\site-packages\openapi_core\validation\validators.py", line 53, in _unmarshal
return unmarshaller(value)
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\unmarshallers.py", line 181, in __call__
properties = self._unmarshal_properties(value)
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\unmarshallers.py", line 225, in _unmarshal_properties
prop)(prop_value)
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\unmarshallers.py", line 146, in __call__
return list(map(self.items_unmarshaller, value))
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\unmarshallers.py", line 181, in __call__
properties = self._unmarshal_properties(value)
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\unmarshallers.py", line 225, in _unmarshal_properties
prop)(prop_value)
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\unmarshallers.py", line 244, in __call__
return self.unmarshallers_factory.create(one_of_schema)(value)
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\unmarshallers.py", line 146, in __call__
return list(map(self.items_unmarshaller, value))
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\unmarshallers.py", line 141, in items_unmarshaller
return self.unmarshallers_factory.create(self.schema.items)
File "D:\.venv\lib\site-packages\openapi_core\unmarshalling\schemas\factories.py", line 48, in create
raise TypeError("schema not type of Schema")
TypeError: schema not type of Schema
Maybe I'm doing something wrong (?!), but not found in OpenAPI documentation any limitation for array in usage with oneOf, so I assume that above spec is valid and issue is definitely in the lib validation.
- Langage dominant
- Python
- Étoiles
- 368
- Forks
- 140
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de python-openapi/openapi-core
-
kind/bug
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
python-openapi/openapi-core#1188 · 2 commentaires ·
-
kind/bug
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
python-openapi/openapi-core#1225 · 2 commentaires ·
-
kind/bug
Difficulté 3/5 1-2 jours Accessibilité débutants 76/100
python-openapi/openapi-core#1212 ·
-
[Bug]: Query parameter validation fails to match empty string when listed as a valid enum value Ouvertekind/bug
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
python-openapi/openapi-core#1210 ·
-
kind/bug kind/bug/confirmed
Difficulté 3/5 1-2 jours Accessibilité débutants 58/100
python-openapi/openapi-core#1180 · 3 commentaires ·
Toutes les issues de python-openapi/openapi-core
Issues similaires
-
Add: hunch Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
DiamondLightSource/dodal#2211 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
openml/openml-python#1749 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
sipyourdrink-ltd/bernstein#6191 ·