Move the func.yaml schema generator off the archived alecthomas/jsonschema
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 42/100
Línea de trabajo
Start in schema/generator/main.go, where the reflector is built from github.com/alecthomas/jsonschema, and in pkg/functions/function_options.go, where the jsonschema and jsonschema_extras tags and the scale minimum workaround live. Swap the import to github.com/invopop/jsonschema, regenerate schema/func_yaml-schema.json, and diff it. Done when the schema is regenerated, make check-schema passes, and the draft-04 output decision is recorded.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
schema/generator builds schema/func_yaml-schema.json with github.com/alecthomas/jsonschema, which was archived in 2022 ("Maintenance has moved to https://github.com/invopop/jsonschema"). Its limits now show up as workarounds in our own code:
minimumis anintparsed withstrconv.Atoi, so a fractional minimum such asscale.kpa.target's0.01silently becomes0. #4067 patches that one field after reflection.- A zero
minimumis omitted, which is why the scale fields declareminimumthroughjsonschema_extras(see the comment above the scale tags inpkg/functions/function_options.go). - Tag descriptions can't contain commas (another comment in
function_options.go).
The maintained successor, github.com/invopop/jsonschema (v0.14.0), keeps the same shape: Reflector, AddGoComments, and the jsonschema / jsonschema_extras tags. It represents minimum/maximum as numbers, so fractional and zero bounds work from the tag directly. The generator is the only Go code that imports the library, so the change is contained.
Possible path:
- Swap the import in
schema/generator/main.go, regenerate, and diff the schema. - Move
minimumback into thejsonschematag wherejsonschema_extrasonly worked around zero being dropped. Remove the generator patch from #4067. - Decide on the draft version. invopop emits 2020-12 with
$defs, where we publish draft-04 withdefinitions. Either keep draft-04 output, or confirm the YAML language server and editors that consume the schema handle 2020-12 before switching.exclusiveMinimumalso changes from a boolean to a number between those drafts. make check-schemakeeps the committed schema in step.
Not urgent: the published schema is only looser than the runtime validation in a few edge cases, and the deploy still rejects invalid values with a clear error.
- Lenguaje dominante
- Go
- Estrellas
- 366
- Forks
- 231
- Merge medio
- 2 d 23 h
- PR fusionados (30 d)
- 50
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 knative/func
-
help wanted kind/good-first-issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
knative/func#4191 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
MCP config_git_set exposes the GitHub token on the func subprocess command linePosiblemente ocupada @anjalirj27 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 30/100
Los mantenedores suelen responder en 2 días
-
Deprecation of legacy parliament Python functions (removal in 1.26)Posiblemente ocupada @gauron99 la tomó hace 4 días. Abiertokind/cleanup lifecycle/frozen
knative/func#4185 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
Function CR sync should keep the spec fields func does not setPosiblemente ocupada @gauron99 la tomó hace 13 días. Abierto
knative/func#4156 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
OCI pusher panics when reused for a second uploadPosiblemente ocupada @shreyashsri79 la tomó hace 18 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
Los mantenedores suelen responder en 2 días
Todos los issues de knative/func
Issues similares
-
[Bug]: gate 缺失Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
Generated cask uses deprecated `postflight` stanza; Homebrew 7 warns on every commandPosiblemente ocupada @k4kratik la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
sachincool/cruft#4 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
VictoriaMetrics/VictoriaLogs#1965 ·
Los mantenedores suelen responder en 1 día
-
kind/bug sig/ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
kubermatic/dashboard#8540 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
elastic/elastic-package#4249 ·
Los mantenedores suelen responder en 1 día