Support for scientific notation
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- backend-api-design
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 126
- Fork
- 36
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
learningequality/ricecooker#747 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
run-llama/llama_index#23199 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
KhronosGroup/glTF-Blender-IO#2769 ·