[BUG](codegen) Union entry-point descriptions are dropped — sourced from FieldInfo.description, never the docstring
I maintainer di solito rispondono entro 2 giorni
@sethfitz ci sta già lavorando.
Dal 23/7/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Summary
A union type-alias entry point renders no description on its generated markdown page, even when it has a docstring. Segment carries a rich description via Segment.__doc__, but the current transportation markdown renders that text zero times -- the # Segment page goes straight from its title to ## Fields.
Root cause
Union descriptions are sourced from FieldInfo.description during type analysis, never from __doc__. capture_union_members (extraction/type_analyzer.py:161) drives analyze_type, whose captured description is "the first FieldInfo.description found during unwrapping." Segment = Annotated[Union[...], Field(discriminator=...)] has exactly one FieldInfo -- the discriminator Field, which carries no description -- so UnionSpec.description resolves to None. The alias's __doc__ (set via Segment.__doc__ = "...") is never consulted.
Contrast with model classes: extract_model reads a class's __doc__ into RecordSpec.description, so a model's docstring renders. Unions have no equivalent path.
The rendering side is not the problem: the union template already emits {% if model.description %}, so a populated UnionSpec.description would render in the right place. The gap is purely sourcing.
Expectation
Give unions the same docstring path models already have -- source the union description from the docstring. The open decision is the sourcing rule / priority:
- the alias or class docstring (
__doc__) FieldInfo.description(the current source -- keep as an override, or drop?)
This is a deliberate output change: it adds a description paragraph to every documented union page.
Relationship to the RootModel migration (#595)
The RootModel migration is the clean enabler. Once a union entry point is a RootModel class rather than an Annotated[...] alias carrying a Segment.__doc__ = assignment, its description lives in a normal class docstring -- a first-class source identical in kind to a model's. Sourcing from an Annotated alias's __doc__ is comparatively fragile.
Because the fix is a deliberate output change, it is deferred out of the byte-identical Segment-as-RootModel spike (the spike keeps UnionSpec.description at None -> None) and tracked here.
- Lingua principale
- Python
- Stelle
- 220
- Fork
- 22
- Merge medio
- 3g 23h
- PR unite (30g)
- 14
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi 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.
Altre issue di OvertureMaps/schema
-
[BUG] `put_required` and its siblings raise a `TypeError` with unformatted placeholdersForse già presa @sethfitz l’ha presa 2 giorni fa. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
OvertureMaps/schema#790 ·
I maintainer di solito rispondono entro 2 giorni
-
[BUG](cli) `validate` reports empty input as a data errorForse già presa @sethfitz l’ha presa 2 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
OvertureMaps/schema#788 ·
I maintainer di solito rispondono entro 2 giorni
-
[DOCS] `make check` reports "no tests ran" without saying whyForse già presa @sethfitz l’ha presa 16 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
OvertureMaps/schema#771 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
OvertureMaps/schema#694 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
OvertureMaps/schema#693 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di OvertureMaps/schema
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
volcengine/OpenViking#6445 ·
I maintainer di solito rispondono entro 1 giorno
-
BUG:Edit Album strips spaces from the password so albums with a leading/trailing space in the password can't be editedForse già presa @ManyaJain111 l’ha presa oggi. Apertabug enhancement possible-duplicate
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
AOSSIE-Org/PictoPy#1637 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
deepspeedai/DeepSpeed#8884 ·
I maintainer di solito rispondono entro 3 giorni
-
Flaky: test_advisor_live_calibrates_an_unmeasured_circuit ranks engines by a 1.8ms sleep marginAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
flagos-ai/FlagQuantum#718 ·
I maintainer di solito rispondono entro 1 giorno
-
bug CI-failure high priority
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
vllm-project/afd-plugin#483 ·
I maintainer di solito rispondono entro 1 giorno