Validate Thing Descriptions during startup
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Comienza rastreando el inicio del servidor y las rutas existentes de generación de ThingDescription y DataSchema. Determina cómo el inicio puede generar una Thing Description y cómo debería funcionar una exclusión voluntaria a nivel de Python, también para el código de prueba. Se considera terminado cuando las anotaciones de tipo diferidas no válidas fallan durante el inicio con un traceback significativo, pero la comprobación se puede deshabilitar.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
If a Thing Description can't be generated for a particular Thing, there's not much point starting the server: it would probably be more useful to fail with a meaningful traceback than start up only to fail when a client attempts to use it.
This is particularly important as we support deferred type annotations: the various models and types associated with a Thing (properties, actions, etc.) are not evaluated until they're needed, meaning the server may finish starting up with Things that still have un-evaluated type hints. These may then later fail to be converted to DataSchema instances as needed by the Thing Description.
I think it would be useful to generate a Thing Description during server start-up, to surface these errors early. This isn't an effort-free process and may take a second or two, but I think we'd get more or less all of the benefit from getting to the stage of having at ThingDescription model: we wouldn't actually need to serialise (or validate) the JSON, though we could.
Clearly there would need to be a way to turn this off. I think it shouldn't be that noticeable when starting an HTTP server, but it would be horrible in test code.
I don't know if it would be a good idea to use the config file to specify whether this happens: I think keeping it Python-only would make it easier to skip when needed (in test suites) but benefit from having a sanity check whenever a server starts.
I may also be pessimistic about how long it takes: it could be very quick at which point I'm worrying unduly (though it would still be a good idea to provide an opt-out).
- Lenguaje dominante
- Python
- Estrellas
- 9
- Forks
- 4
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la 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.
Más de labthings/labthings-fastapi
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
labthings/labthings-fastapi#405 ·
-
Use `Exception.add_note`Abiertodrop-python-version
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
labthings/labthings-fastapi#354 ·
-
Log propagation issueAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
labthings/labthings-fastapi#312 · 1 comentario ·
-
enhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
labthings/labthings-fastapi#407 ·
-
Observable functional propertiesAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
labthings/labthings-fastapi#404 · 2 comentarios ·
Todos los issues de labthings/labthings-fastapi
Issues similares
-
Broken links found in docsAbiertodocs pydanty:is-working
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
pydantic/pydantic-ai#10113 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
GreedyBear-Project/GreedyBear#1727 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
ARM-software/CMSIS-DSP#354 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
kiat/codeAssist#391 ·
-
needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
darnitdevorg/darnit#587 ·
Los mantenedores suelen responder en 1 día