Support for scientific notation
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- python
- Área
- backend-api-design
Línea de trabajo
Start with the supplied OpenAPI 3.0.3 schema and its maximum: 1e2 value, comparing it with the equivalent maximum: 100 case. Trace how the validator handles the scientific-notation value, then verify that the reported schema validates without weakening the numeric constraint checks.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
This schema with scientific notation maximum: 1e2
openapi: 3.0.3
info:
title: scientific notation
description: ...
version: 1.0.0
paths:
/pet:
put:
tags:
- pet
summary: ...
description: ...
operationId: updatePet
requestBody:
description: ...
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
responses:
'200':
description: Successful operation
components:
schemas:
Pet:
type: object
properties:
id:
type: integer
format: int64
maximum: 1e2
example: 10
results in this unexpected failure
# Validation Error
{'description': '...', 'content': {'application/json': {'schema': {'type': 'object', 'properties': {'id': {'type': 'integer', 'format': 'int64', 'maximum': '1e2', 'example': 10}}}}}} is not valid under any of the given schemas
Failed validating 'oneOf' in schema['properties']['paths']['patternProperties']['^\\/']['patternProperties']['^(get|put|post|delete|options|head|patch|trace)$']['properties']['requestBody']:
{'oneOf': [{'$ref': '#/definitions/RequestBody'},
{'$ref': '#/definitions/Reference'}]}
On instance['paths']['/pet']['put']['requestBody']:
{'content': {'application/json': {'schema': {'properties': {'id': {'example': 10,
'format': 'int64',
'maximum': '1e2',
'type': 'integer'}},
'type': 'object'}}},
'description': '...'}
# Due to one of those errors
## {'type': 'object', 'properties': {'id': {'type': 'integer', 'format': 'int64', 'maximum': '1e2', 'example': 10}}} is not valid under any of the given schemas
Failed validating 'oneOf' in schema[0]['properties']['content']['additionalProperties']['properties']['schema']:
{'oneOf': [{'$ref': '#/definitions/Schema'},
{'$ref': '#/definitions/Reference'}]}
On instance['content']['application/json']['schema']:
{'properties': {'id': {'example': 10,
'format': 'int64',
'maximum': '1e2',
'type': 'integer'}},
'type': 'object'}
## '$ref' is a required property
Failed validating 'required' in schema[1]:
{'patternProperties': {'^\\$ref$': {'format': 'uri-reference',
'type': 'string'}},
'required': ['$ref'],
'type': 'object'}
On instance:
{'content': {'application/json': {'schema': {'properties': {'id': {'example': 10,
'format': 'int64',
'maximum': '1e2',
'type': 'integer'}},
'type': 'object'}}},
'description': '...'}
...
If I change maximum: 1e2 to maximum: 100, it validates without error.
- Lenguaje dominante
- Python
- Estrellas
- 126
- Forks
- 36
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Issues similares
-
Add: hunch Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
DiamondLightSource/dodal#2211 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
openml/openml-python#1749 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
sipyourdrink-ltd/bernstein#6191 ·