"uri" format not supported

Abierto
#275 2 comentarios 0 reacciones 0 asignados Ver en GitHub

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
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
api

Línea de trabajo

Start with openapi-core's format validation path and the handling of the OpenAPI schema shown in the report, using the uri example from the issue. Confirm that validation no longer fails for the provided URL when uri is supported or treated as unknown, and add or update coverage for this behavior.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

I have an OpenAPI Schema that I'm generating from a Django (a python web framework) using a library called drf-spectacular. Fields that contain a URL are generated as a "type: string" with "format: uri" by this library. When validating with openapi-core I get this error:

Failed validating 'format' in schema['properties']['owner']:
    {'format': 'uri', 'nullable': False, 'readOnly': True, 'type': 'string'}

On instance['owner']:
    'https://whatever/blah/'
Format checker for 'uri' format not found

Though uri is not defined as a built-in format in the OpenAPI spec, according to the specs format can contain other values, and unrecognized formats should not be validated.

So I think openapi-core should either support the uri format or ignore it, but not fail validation.

Lenguaje dominante
Python
Estrellas
368
Forks
140
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de python-openapi/openapi-core

Todos los issues de python-openapi/openapi-core

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.