CBG-5715: add x-enumDescriptions to enums that only listed values - #8653
CBG-5715: add x-enumDescriptions to enums that only listed values#8653torcolvin wants to merge 2 commits into
Conversation
|
Droid finished @torcolvin's task —— View job The added enum descriptions are a solid documentation improvement, but there are a couple of concrete accuracy issues to correct (a contradictory “Default” label for |
Review follow-ups on #8653: - `_sgcollect_info` `redact_level` declared `default: partial`, which contradicts the implementation. `rest/sgcollect.go:389` only passes `--log-redaction-level` when the field is set, and `tools/sgcollect.py:150` defaults that option to `none`, so omitting `redact_level` collects unredacted logs. - Four `channels` descriptions in the public and admin `_changes` specs referred to the filter as `sync_gateway/bychannels`, which is not a valid value. `base.ByChannelFilter` is `sync_gateway/bychannel`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Redocly previews |
There was a problem hiding this comment.
Pull request overview
Improves the Sync Gateway OpenAPI documentation in docs/api/ by adding x-enumDescriptions to previously under-documented enums (which otherwise render as unannotated value lists), and by correcting a few enum-related documentation issues so Redocly renders the intended descriptions.
Changes:
- Add
x-enumDescriptionsfor_changesenums (style/filter/feed) in both public and admin specs, and fix thesync_gateway/bychannelreference in thechannelsparameter description. - Add
x-enumDescriptionsfor replication control action (start|stop|reset),_profile/{name}profile types, and_sgcollect_inforedact_level(also correcting its documented default tonone). - Replace pre-existing
x-enumDescription(singular) withx-enumDescriptions(plural) for audit logging domain enums, and add enum descriptions for several other schemas (e.g.,same_site_cookie, migration/resync statuses, logging redaction level).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| docs/api/paths/public/keyspace-_changes.yaml | Documents public _changes enum values (style/filter/feed) via x-enumDescriptions and corrects the bychannel filter reference. |
| docs/api/paths/admin/keyspace-_changes.yaml | Mirrors the public _changes enum documentation and bychannel reference fix for the admin endpoint. |
| docs/api/paths/admin/db-_replicationStatus-replicationid.yaml | Adds x-enumDescriptions for replication action query parameter values. |
| docs/api/paths/admin/_sgcollect_info.yaml | Corrects redact_level default and documents enum meanings with x-enumDescriptions. |
| docs/api/paths/admin/_profile-profilename.yaml | Adds descriptions for supported profile name enum values. |
| docs/api/components/schemas.yaml | Fixes audit logging enum extension name and adds enum descriptions for SameSite, migration/resync statuses, and logging redaction level. |
| docs/api/components/parameters.yaml | Adds enum descriptions for the compaction type parameter values. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Review follow-ups on #8653: - `_sgcollect_info` `redact_level` declared `default: partial`, which contradicts the implementation. `rest/sgcollect.go:389` only passes `--log-redaction-level` when the field is set, and `tools/sgcollect.py:150` defaults that option to `none`, so omitting `redact_level` collects unredacted logs. - Four `channels` descriptions in the public and admin `_changes` specs referred to the filter as `sync_gateway/bychannels`, which is not a valid value. `base.ByChannelFilter` is `sync_gateway/bychannel`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
83f1e9f to
c22f5bd
Compare
These enums rendered as a bare list of allowed values, leaving the reader
to guess what each one does. Document each value using the same
`x-enumDescriptions` extension already used elsewhere in the specs:
- `_compact?type`, `_profile/{name}`, `_sgcollect_info` redact_level
- `_replicationStatus/{id}` action
- `_changes` style, filter and feed (public and admin)
- resync, attachment migration and metadata migration status
- logging redaction_level, unsupported session_cookie_samesite
Also fix six pre-existing uses of the singular `x-enumDescription` on the
audit logging `domain` fields. Redocly only recognises the plural form,
so the cbs/sgw descriptions were being silently dropped.
`Compact-status.phase` is deliberately left out: its enum is currently
attached to the wrong property, which is a separate fix.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review follow-ups on #8653: - `_sgcollect_info` `redact_level` declared `default: partial`, which contradicts the implementation. `rest/sgcollect.go:389` only passes `--log-redaction-level` when the field is set, and `tools/sgcollect.py:150` defaults that option to `none`, so omitting `redact_level` collects unredacted logs. - Four `channels` descriptions in the public and admin `_changes` specs referred to the filter as `sync_gateway/bychannels`, which is not a valid value. `base.ByChannelFilter` is `sync_gateway/bychannel`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
c22f5bd to
74fa0b7
Compare
CBG-5715
Split out of #8589 — stack 5/9, based on #8652.
These enums rendered as a bare list of allowed values, leaving the reader to guess what each one does. Document each value using the same
x-enumDescriptionsextension already used elsewhere in the specs:_compact?type,_profile/{name},_sgcollect_inforedact_level_replicationStatus/{id}action_changesstyle, filter and feed (public and admin)Also fixes six pre-existing uses of the singular
x-enumDescriptionon the audit loggingdomainfields. Redocly only recognises the plural form, so those cbs/sgw descriptions were being silently dropped.Compact-status.phaseis deliberately left out: its enum is currently attached to the wrong property, which is the next PR in the stack.Both of @bbrks' description comments on #8589 are incorporated here:
_sgcollect_inforedaction:noneis the default, notpartial(tools/sgcollect.py:150—--log-redaction-leveldefault="none").longpollis one-shot:changes_api.go:346setsoptions.Wait = trueand calls the samesendSimpleChangespath asnormal, so it sends a single response.Other factual claims verified: redaction
fullandunsetboth fall throughSetRedactiontoRedactUserData = true, i.e. they behave aspartial;same_site_cookie: Defaultomits the attribute (auth/session.go:192);resetrequires a stopped replication (db/sg_replicate_cfg.go:444).Pre-review checklist
docs/api🤖 Generated with Claude Code