Skip to content

Fix/coverage quirks - #85

Merged
fredbi merged 2 commits into
go-openapi:masterfrom
fredbi:fix/coverage-quirks
Aug 5, 2026
Merged

fredbi merged 2 commits into
go-openapi:masterfrom
fredbi:fix/coverage-quirks

Conversation

@fredbi

@fredbi fredbi commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Change type

Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update

Short description

Fixes

Full description

Checklist

  • I have signed all my commits with my name and email (see DCO. This does not require a PGP-signed commit
  • I have rebased and squashed my work, so only one commit remains
  • I have added tests to cover my changes.
  • I have properly enriched go doc comments in code.
  • I have properly documented any breaking change.

fredbi and others added 2 commits August 5, 2026 09:08
A field whose type is a model becomes a $ref, and a bare $ref carries no
siblings — so when the field's only decoration is prose, the legacy
default emits {$ref} and the description goes with it. That is deliberate
and unchanged here, but it was the one drop on that path that said
nothing: SkipAllOfCompounding reports every sibling it discards, while
the description-only default reported none. An author watching a
description vanish had nothing to tell them EmitRefSiblings would keep
it.

The drop now raises CodeDroppedRefSibling as a Hint, naming the field and
the option that preserves it. A Hint rather than a Warning: nothing is
wrong, the default simply cannot carry prose beside a $ref. The code's
documentation now describes both of its causes, told apart by severity.

No emitted spec changes — the goldens are untouched across the corpus,
which is the whole claim: only the diagnostic stream grew.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
walkPathItemProse guarded against a nil operation, but operationsByMethod
yields only the methods a path item actually defines, so the branch could
never be taken. It is gone, replaced by a comment saying why no guard is
needed.

walkSchemaProse's anyOf and oneOf arms, and the tuple form of items,
cannot fire either — for a different reason: a Swagger 2.0 document has
no such constructs. Those stay, because the walk has to remain total over
the schema type and they become live the day the emitter targets OAS 3.x,
but they now say so rather than reading as untested paths.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
@fredbi
fredbi merged commit fed91e5 into go-openapi:master Aug 5, 2026
22 checks passed
@fredbi
fredbi deleted the fix/coverage-quirks branch August 5, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⌂ 换网址