Skip to content

feat: add tag groups#2

Merged
zoobzio merged 1 commit intomainfrom
feat/tag-groups
Feb 4, 2026
Merged

feat: add tag groups#2
zoobzio merged 1 commit intomainfrom
feat/tag-groups

Conversation

@zoobzio
Copy link
Collaborator

@zoobzio zoobzio commented Feb 4, 2026

Summary by CodeRabbit

  • New Features

    • Added tag grouping to the OpenAPI spec to organize tags into logical groups.
  • Documentation

    • Documented the new tag grouping feature and its usage.
  • Tests

    • Added validation tests for tag grouping.
  • Chores

    • Added repository metadata, branch protection and CI final-gate configuration.
    • Added a CODEOWNERS configuration.

@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

Adds a new public type TagGroup and a TagGroups field (serialized as x-tagGroups) to the OpenAPI struct, updates docs and tests for the new type, and adds GitHub repository configuration including CODEOWNERS, settings, and a CI completion job.

Changes

Cohort / File(s) Summary
GitHub config
\.github/CODEOWNERS, \.github/settings.yml, \.github/workflows/ci.yml
Adds repository CODEOWNERS, repository metadata and branch protection settings, and a final ci-complete workflow job that gates overall CI success.
Core types
openapi.go
Adds exported TagGroup type and a TagGroups []TagGroup field to the OpenAPI struct with JSON/YAML tags x-tagGroups.
Documentation
docs/3.types.md
Documents the new TagGroup type and the x-tagGroups vendor extension on the OpenAPI root.
Tests
openapi_test.go
Adds TestTagGroup to validate TagGroup.Name and TagGroup.Tags (appears duplicated in diff).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Poem

🐰 I hopped through specs with glee and cheer,

Tags in bundles now gather near.
x-tagGroups line the path we trod,
Owned and watched — a tidy wodd.
🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add tag groups' directly summarizes the main change: adding a new TagGroup type and TagGroups field to the OpenAPI structure, with supporting documentation, tests, configuration, and CI updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/tag-groups

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f4ea0b6 and 21fa3a0.

📒 Files selected for processing (6)
  • .github/CODEOWNERS
  • .github/settings.yml
  • .github/workflows/ci.yml
  • docs/3.types.md
  • openapi.go
  • openapi_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/3.types.md
  • .github/CODEOWNERS
🧰 Additional context used
🧬 Code graph analysis (1)
openapi_test.go (1)
openapi.go (1)
  • TagGroup (192-195)
🔇 Additional comments (5)
openapi.go (2)

14-14: LGTM!

The TagGroups field correctly implements the x-tagGroups vendor extension with appropriate JSON/YAML struct tags and omitempty for optional serialization.


191-195: LGTM!

The TagGroup struct is well-defined with correct struct tags. The Name field is required (no omitempty) while Tags is optional, which aligns with the Redoc x-tagGroups specification.

openapi_test.go (1)

298-313: LGTM!

The test follows the established patterns in this file and covers basic field validation. The length check on line 307 guards against the index access on line 310.

Consider adding a test that validates TagGroups integration within the OpenAPI struct (similar to how TestOpenAPI_Structure tests other fields), though this can be deferred.

.github/workflows/ci.yml (2)

81-92: LGTM! The aggregator job correctly gates PRs on all CI checks.

The ci-complete job properly:

  • Uses if: always() to run regardless of dependency outcomes
  • Depends on all three CI jobs via needs
  • Validates each job succeeded before completing

One minor note: the file appears to be missing a trailing newline after line 92.


14-15: Go versions 1.24 and 1.25 are confirmed as released and available.

Both versions are officially released (1.24 on February 11, 2025; 1.25 on August 12, 2025) and actively maintained with recent patch releases available as of February 2026. The actions/setup-go@v5 action supports these versions through its automatic resolution mechanism that pulls from the official Go downloads. The matrix specification is valid.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

📊 Coverage Report

Total Coverage: 97.1%

Coverage by Package

github.com/zoobzio/openapi/json.go:7:		ToJSON		100.0%
github.com/zoobzio/openapi/json.go:12:		FromJSON	100.0%
github.com/zoobzio/openapi/schema_type.go:18:	NewSchemaType	100.0%
github.com/zoobzio/openapi/schema_type.go:23:	NewSchemaTypes	100.0%
github.com/zoobzio/openapi/schema_type.go:31:	IsEmpty		100.0%
github.com/zoobzio/openapi/schema_type.go:43:	IsArray		100.0%
github.com/zoobzio/openapi/schema_type.go:51:	String		83.3%
github.com/zoobzio/openapi/schema_type.go:67:	Strings		100.0%
github.com/zoobzio/openapi/schema_type.go:82:	Contains	100.0%
github.com/zoobzio/openapi/schema_type.go:92:	IsNullable	100.0%
github.com/zoobzio/openapi/schema_type.go:97:	MarshalJSON	100.0%
github.com/zoobzio/openapi/schema_type.go:105:	UnmarshalJSON	100.0%
github.com/zoobzio/openapi/schema_type.go:132:	MarshalYAML	100.0%
github.com/zoobzio/openapi/schema_type.go:140:	UnmarshalYAML	91.7%
github.com/zoobzio/openapi/yaml.go:6:		ToYAML		100.0%
github.com/zoobzio/openapi/yaml.go:11:		FromYAML	100.0%

Coverage report generated by Codecov

@codecov
Copy link

codecov bot commented Feb 4, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/settings.yml:
- Around line 20-23: The branch protection requires a status check "CI Complete"
that does not exist; update the required_status_checks.contexts to match actual
workflow job names (e.g., "Test", "Lint", "Benchmark") or add a new CI job named
"CI Complete" that depends on all other jobs so GitHub will produce that status
check; modify the contexts array under required_status_checks accordingly and/or
add a workflow job called "CI Complete" that uses needs: [Test, Lint, Benchmark]
to aggregate results.
🧹 Nitpick comments (1)
openapi_test.go (1)

298-313: Test coverage is adequate, consider testing TagGroups integration.

The test validates TagGroup struct creation correctly. Consider adding a test case that verifies TagGroups field on the OpenAPI struct works as expected (similar to how TestTag exists alongside Tags being tested as part of OpenAPI structures).

💡 Optional: Add integration test for OpenAPI.TagGroups
func TestOpenAPI_WithTagGroups(t *testing.T) {
	spec := &OpenAPI{
		OpenAPI: "3.1.0",
		Info:    Info{Title: "Test", Version: "1.0.0"},
		Paths:   make(map[string]PathItem),
		TagGroups: []TagGroup{
			{Name: "Account", Tags: []string{"Authentication", "Users"}},
		},
	}

	if len(spec.TagGroups) != 1 {
		t.Errorf("expected 1 tag group, got %d", len(spec.TagGroups))
	}
	if spec.TagGroups[0].Name != "Account" {
		t.Errorf("expected tag group name 'Account', got %q", spec.TagGroups[0].Name)
	}
}
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 958a972 and f4ea0b6.

📒 Files selected for processing (5)
  • .github/CODEOWNERS
  • .github/settings.yml
  • docs/3.types.md
  • openapi.go
  • openapi_test.go
🧰 Additional context used
🧬 Code graph analysis (1)
openapi_test.go (1)
openapi.go (1)
  • TagGroup (192-195)
🔇 Additional comments (6)
.github/CODEOWNERS (1)

1-4: LGTM!

The CODEOWNERS file is correctly formatted and aligns with the branch protection settings in settings.yml that require code owner reviews.

docs/3.types.md (2)

34-35: LGTM!

Documentation accurately reflects the new TagGroups field addition to the OpenAPI root object.


210-212: LGTM!

The TagGroup type documentation is clear and accurately documents the vendor extension structure with Name and Tags[] fields.

openapi.go (2)

14-14: LGTM!

The TagGroups field is correctly added with the x-tagGroups vendor extension key and omitempty to exclude when empty.


191-195: LGTM!

The TagGroup struct is well-designed:

  • Name is required (no omitempty)
  • Tags is optional with omitempty
  • JSON/YAML tags are consistent with the rest of the codebase
.github/settings.yml (1)

1-11: LGTM!

Repository settings are well-configured with squash-only merges and automatic branch deletion, which helps maintain a clean commit history.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@zoobzio zoobzio merged commit 27ddf5a into main Feb 4, 2026
10 checks passed
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