Skip to content

Implement builder package for programmatic OpenAPI specification construction#52

Merged
erraggy merged 15 commits intomainfrom
copilot/implement-builder-package
Nov 29, 2025
Merged

Implement builder package for programmatic OpenAPI specification construction#52
erraggy merged 15 commits intomainfrom
copilot/implement-builder-package

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 28, 2025

  • Understand the implementation plan in planning/implement-builder.md
  • Explore existing package patterns (parser, joiner, converter)
  • Verify codebase builds and tests pass
  • Phase 1: Create builder/doc.go with package documentation
  • Phase 1: Implement Builder struct and New() function in builder.go
  • Phase 1: Implement core reflection engine (reflect.go) - primitive types, structs, slices, maps, pointers
  • Phase 1: Implement schema caching (reflect_cache.go)
  • Phase 2: Implement json tag parsing for field names and omitempty
  • Phase 2: Implement oas tag parsing (tags.go) - description, format, enum, constraints
  • Phase 2: Implement required field detection
  • Phase 3: Implement AddOperation() with reflection-based options
  • Phase 3: Implement WithResponse(), WithRequestBody(), WithQueryParam(), WithPathParam(), WithHeaderParam()
  • Phase 3: Automatic schema registration in components.schemas
  • Phase 4: Handle circular references, embedded structs, interface{}/any, time.Time, uuid.UUID
  • Phase 5: Implement server configuration (AddServer(), ServerOption)
  • Phase 5: Implement tag configuration (AddTag(), TagOption)
  • Phase 5: Implement security configuration
  • Phase 5: Implement BuildOAS2(), BuildOAS3(), BuildResult(), WriteFile(), MarshalYAML(), MarshalJSON()
  • Phase 6: Implement FromDocument() for existing document integration
  • Phase 6: Add comprehensive unit tests (94.8% coverage)
  • Phase 6: Add benchmark tests
  • Phase 6: Add godoc examples
  • Phase 6: Update README.md with builder package description
  • Phase 6: Run code review and address feedback
  • Phase 6: Run security scanner and address issues (no vulnerabilities found)
  • Address PR review feedback:
    • Replace AddResponseWithContentType with WithResponseContentType option
    • Move responseConfig, ResponseOption funcs to response.go
    • Move paramConfig, ParamOption funcs to parameter.go
    • Move tagConfig, TagOption funcs to tags.go
    • Remove Build() that returns any (use BuildOAS2()/BuildOAS3())
    • Remove NewOAS2/NewOAS3 in favor of single New() constructor
    • Remove OAS validation (document to use validator package instead)
    • Remove exported SchemaFrom/SchemaFromType functions
    • Fix nil dereference in generateStructSchema for embedded structs
    • Update doc.go with new API and validation documentation
Original prompt

On implement-builder.md, Please implement this builder package and submit it as a pull request


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: erraggy <366249+erraggy@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement builder package as requested Implement builder package for programmatic OpenAPI specification construction Nov 28, 2025
Copilot AI requested a review from erraggy November 28, 2025 10:49
@erraggy erraggy marked this pull request as ready for review November 28, 2025 15:41
@erraggy erraggy requested a review from Copilot November 28, 2025 15:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request implements a comprehensive builder package for programmatic OpenAPI specification construction with reflection-based schema generation. The implementation provides a fluent API that automatically converts Go types to OpenAPI schemas, supporting struct tags for fine-grained control and handling complex scenarios like circular references and embedded structs.

Key Changes

  • Reflection engine: Automatic schema generation from Go types with caching and circular reference detection
  • Fluent builder API: Chain-able methods for constructing complete OAS documents programmatically
  • Struct tag support: json and oas tags for customizing schema generation with validation constraints

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
builder/builder.go Core Builder struct with info setters, Build/Marshal methods, and document construction
builder/reflect.go Type-to-Schema reflection engine with special type handling (time.Time, uuid.UUID)
builder/reflect_cache.go Schema caching mechanism with circular reference detection
builder/tags.go JSON and OAS struct tag parsing and application logic
builder/operation.go Operation builder with parameter/response/request body options
builder/server.go Server and server variable configuration
builder/security.go Security scheme builders and tag management
builder/response.go Reusable response components
builder/parameter.go Reusable parameter components
builder/doc.go Package documentation with examples
builder/*_test.go Comprehensive test suite with 85+ tests
builder/builder_bench_test.go Performance benchmarks (contains critical bug)
builder/example_test.go Example-based documentation tests
README.md Updated documentation with builder package examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread builder/tags.go Outdated
Comment on lines +214 to +226
// Copy slices (shallow reference)
result.Enum = s.Enum
result.Required = s.Required
result.Examples = s.Examples
result.AllOf = s.AllOf
result.AnyOf = s.AnyOf
result.OneOf = s.OneOf

// Copy maps (shallow reference)
result.Properties = s.Properties
result.PatternProperties = s.PatternProperties
result.DependentRequired = s.DependentRequired
result.DependentSchemas = s.DependentSchemas
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The copySchema function performs a shallow copy of slices and maps (lines 214-226). This is documented as intentional, but it could lead to unexpected mutations when the copy is modified. For example, if applyOASTag modifies the Enum slice (line 112 in applyOASTag), it creates a new slice which is fine. However, if someone directly modifies result.Properties or result.Required, it would affect the original schema.

Consider doing a deep copy for at least the Enum and Required slices since applyOASTag already creates new slices for Enum. For consistency and safety, consider deep copying these mutable fields:

// Deep copy slices that might be modified
if s.Enum != nil {
    result.Enum = make([]any, len(s.Enum))
    copy(result.Enum, s.Enum)
}
if s.Required != nil {
    result.Required = make([]string, len(s.Required))
    copy(result.Required, s.Required)
}

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Applied deep copy for Enum and Required slices, as well as all pointer fields for consistency and safety. See commit 6d08379.

Comment thread builder/builder_bench_test.go
Comment thread README.md
Comment thread builder/tags.go Outdated
Comment on lines +201 to +212
// Copy pointers (shallow)
result.Minimum = s.Minimum
result.Maximum = s.Maximum
result.MinLength = s.MinLength
result.MaxLength = s.MaxLength
result.MinItems = s.MinItems
result.MaxItems = s.MaxItems
result.MinProperties = s.MinProperties
result.MaxProperties = s.MaxProperties
result.MultipleOf = s.MultipleOf
result.ExclusiveMaximum = s.ExclusiveMaximum
result.ExclusiveMinimum = s.ExclusiveMinimum
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The shallow copy of pointer fields (lines 201-212) could lead to unintended sharing of pointer values. If applyOASTag modifies these pointer fields (e.g., at lines 118-134), it would affect both the original and copied schema since they share the same pointer.

Currently applyOASTag creates new pointers (e.g., line 119: result.Minimum = &f), so this is safe. However, this coupling creates a fragile dependency - if applyOASTag is later modified to reuse pointers, bugs would be introduced.

For better safety and maintainability, consider deep copying the pointer fields:

// Deep copy pointer fields
if s.Minimum != nil {
    minCopy := *s.Minimum
    result.Minimum = &minCopy
}
if s.Maximum != nil {
    maxCopy := *s.Maximum
    result.Maximum = &maxCopy
}
// ... repeat for other pointer fields
Suggested change
// Copy pointers (shallow)
result.Minimum = s.Minimum
result.Maximum = s.Maximum
result.MinLength = s.MinLength
result.MaxLength = s.MaxLength
result.MinItems = s.MinItems
result.MaxItems = s.MaxItems
result.MinProperties = s.MinProperties
result.MaxProperties = s.MaxProperties
result.MultipleOf = s.MultipleOf
result.ExclusiveMaximum = s.ExclusiveMaximum
result.ExclusiveMinimum = s.ExclusiveMinimum
// Deep copy pointer fields
if s.Minimum != nil {
minCopy := *s.Minimum
result.Minimum = &minCopy
}
if s.Maximum != nil {
maxCopy := *s.Maximum
result.Maximum = &maxCopy
}
if s.MinLength != nil {
minLenCopy := *s.MinLength
result.MinLength = &minLenCopy
}
if s.MaxLength != nil {
maxLenCopy := *s.MaxLength
result.MaxLength = &maxLenCopy
}
if s.MinItems != nil {
minItemsCopy := *s.MinItems
result.MinItems = &minItemsCopy
}
if s.MaxItems != nil {
maxItemsCopy := *s.MaxItems
result.MaxItems = &maxItemsCopy
}
if s.MinProperties != nil {
minPropsCopy := *s.MinProperties
result.MinProperties = &minPropsCopy
}
if s.MaxProperties != nil {
maxPropsCopy := *s.MaxProperties
result.MaxProperties = &maxPropsCopy
}
if s.MultipleOf != nil {
multOfCopy := *s.MultipleOf
result.MultipleOf = &multOfCopy
}
if s.ExclusiveMaximum != nil {
exclMaxCopy := *s.ExclusiveMaximum
result.ExclusiveMaximum = &exclMaxCopy
}
if s.ExclusiveMinimum != nil {
exclMinCopy := *s.ExclusiveMinimum
result.ExclusiveMinimum = &exclMinCopy
}

Copilot uses AI. Check for mistakes.
Co-authored-by: erraggy <366249+erraggy@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 28, 2025

Codecov Report

❌ Patch coverage is 93.67442% with 68 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.52%. Comparing base (daf63d2) to head (b8a8525).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
builder/builder.go 90.03% 14 Missing and 15 partials ⚠️
builder/reflect.go 84.32% 20 Missing and 9 partials ⚠️
builder/operation.go 97.46% 3 Missing and 3 partials ⚠️
builder/tags.go 97.81% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
+ Coverage   62.18%   66.52%   +4.34%     
==========================================
  Files          33       42       +9     
  Lines        6720     7795    +1075     
==========================================
+ Hits         4179     5186    +1007     
- Misses       2031     2070      +39     
- Partials      510      539      +29     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@erraggy
Copy link
Copy Markdown
Owner

erraggy commented Nov 28, 2025

@copilot please address the code coverage feedback posted in the previous comment.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 28, 2025

@copilot please address the code coverage feedback posted in the previous comment.

I don't see the code coverage feedback in the visible comments. Could you please point me to the specific feedback or repost it here?

@erraggy
Copy link
Copy Markdown
Owner

erraggy commented Nov 28, 2025

@copilot I have quote replied the code coverage feedback comment below. Please address.

Codecov Report

❌ Patch coverage is 81.50538% with 172 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.53%. Comparing base (daf63d2) to head (6d08379).

Files with missing lines Patch % Lines
builder/response.go 0.00% 36 Missing ⚠️
builder/tags.go 80.11% 22 Missing and 13 partials ⚠️
builder/builder.go 80.48% 19 Missing and 13 partials ⚠️
builder/reflect.go 81.48% 24 Missing and 6 partials ⚠️
builder/parameter.go 20.00% 20 Missing ⚠️
builder/security.go 78.18% 12 Missing ⚠️
builder/operation.go 97.67% 3 Missing and 3 partials ⚠️
builder/reflect_cache.go 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
+ Coverage   62.18%   64.53%   +2.34%     
==========================================
  Files          33       42       +9     
  Lines        6720     7650     +930     
==========================================
+ Hits         4179     4937     +758     
- Misses       2031     2168     +137     
- Partials      510      545      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@erraggy
Copy link
Copy Markdown
Owner

erraggy commented Nov 28, 2025

@copilot please try again

Co-authored-by: erraggy <366249+erraggy@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 28, 2025

@copilot please try again

Improved test coverage from 81.5% to 96.0%. Added tests for:

  • response.go: AddResponse, AddResponseWithContentType, ResponseRef (was 0%)
  • parameter.go: AddParameter, ParameterRef (was 20%)
  • security.go: AddOAuth2SecurityScheme, AddOpenIDConnectSecurityScheme
  • tags.go: deep copy pointer fields and slices in copySchema
  • builder.go: error paths for BuildResult, MarshalYAML, MarshalJSON, WriteFile
  • reflect.go: SchemaFromType, getNameForType, extractRefName
  • FromDocument: comprehensive tests for all component types

See commit f24c30d.

@erraggy
Copy link
Copy Markdown
Owner

erraggy commented Nov 29, 2025

@copilot It appears that the builder will always target OAS 3.x base URIs in the $ref values it builds, but a new builder accepts the OAS version as its only arg, and stores it, so I would assume the document it builds would match the OAS version used to New it up. If my assumption is incorrect, please explain how, and if it is accurate, please address this error in the builder's logic.

Co-authored-by: erraggy <366249+erraggy@users.noreply.github.com>
@erraggy
Copy link
Copy Markdown
Owner

erraggy commented Nov 29, 2025

@copilot please try to pick up where you left off when my account was rate limited. Also, please keep in mind that the builder package has never been merged to main or released, so any "breaking" changes in the process of this PR should not use // Deprecated... deprecations and instead freely make such changes.

Co-authored-by: erraggy <366249+erraggy@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 29, 2025

@copilot please try to pick up where you left off when my account was rate limited. Also, please keep in mind that the builder package has never been merged to main or released, so any "breaking" ch...

Fixed the compilation errors in example_test.go and continued from where work was interrupted. The builder now provides:

  1. Type-safe API: NewOAS2() + BuildOAS2() and NewOAS3(v) + BuildOAS3() return typed documents without needing type assertions.

  2. Version-specific $ref paths:

    • OAS 2.0: #/definitions/, #/parameters/, #/responses/
    • OAS 3.x: #/components/schemas/, #/components/parameters/, #/components/responses/
  3. Removed Deprecated: markers since this is a new unreleased package.

All tests pass with 95.0% coverage. See commit 1c050c7.

@erraggy
Copy link
Copy Markdown
Owner

erraggy commented Nov 29, 2025

Code Review: Builder Package (PR #52)

This is a comprehensive code review of the new builder package for programmatic OpenAPI specification construction.

Summary

This PR introduces a well-designed builder package that enables programmatic construction of OpenAPI specifications using Go's reflection system. Overall, this is high-quality code that follows the project's conventions and provides a valuable addition to the oastools toolkit.


✅ Strengths

Architecture & Design

  • Fluent API pattern: The builder pattern with method chaining (SetTitle().SetVersion().AddOperation()) provides an excellent developer experience
  • Type-safe API: The NewOAS2() + BuildOAS2() and NewOAS3() + BuildOAS3() pairs eliminate runtime type assertion errors
  • Version-aware $ref paths: Correctly uses #/definitions/ for OAS 2.0 and #/components/schemas/ for OAS 3.x
  • Functional options pattern: Uses idiomatic Go options pattern (WithOperationID(), WithResponse(), etc.) for configuration

Code Quality

  • Excellent test coverage: 95.0% statement coverage with comprehensive unit tests
  • Comprehensive benchmarks: 15 benchmarks covering all major operations using the modern b.Loop() pattern
  • Complete documentation: Thorough package documentation (doc.go) with examples and godoc-compatible examples (example_test.go)
  • Follows project conventions: Uses internal/httputil constants for HTTP methods, proper error handling patterns

Reflection Engine

  • Schema caching: Prevents redundant schema generation and handles circular references correctly
  • Embedded struct support: Properly inlines properties from embedded structs
  • Generic type handling: Sanitizes bracket characters for URI safety (Response[User]Response_User)
  • Conflict detection: Uses package.TypeName naming with full path disambiguation when needed

Security & Safety

  • File permissions: Uses 0600 (owner read/write only) for file writes - secure default
  • Deep copy in copySchema(): Properly deep-copies pointer fields and slices to prevent mutations

🔍 Issues Found

Minor Issue: Unused Method (Informational)

Location: builder/builder.go:62 (via gopls diagnostics)

// reflect_cache.go
func (c *schemaCache) hasName(name string) bool {
    _, exists := c.byName[name]
    return exists
}

Issue: The hasName method on schemaCache is defined but never used.

Recommendation: Either remove this unused method, or if it's intended for future use, add a test that exercises it or mark it with a comment explaining planned usage. Per CLAUDE.md guidelines, "Avoid backwards-compatibility hacks like renaming unused _vars... If something is unused, delete it completely."


Potential Enhancement: FromDocument OAS 2.0 Support

Location: builder/builder.go:428-479

func FromDocument(doc *parser.OAS3Document) *Builder {

Observation: FromDocument only accepts *parser.OAS3Document. There's no equivalent for OAS 2.0 documents.

Recommendation: Consider adding FromOAS2Document(*parser.OAS2Document) *Builder for parity, or document this limitation clearly in the function's godoc comment.


Edge Case: Empty operations check

Location: builder/operation.go:446-460

// Build responses object
var responses *parser.Responses
if len(cfg.responses) > 0 {
    responses = &parser.Responses{
        Codes: make(map[string]*parser.Response),
    }

Observation: When building an operation, if no responses are specified, the Responses field will be nil. While this may be intentional, the OpenAPI spec requires at least one response.

Recommendation: Consider adding validation that warns when an operation has no responses defined, since this would fail OAS validation.


⚡ Performance Assessment

The benchmark results show excellent performance:

Operation Time Memory Allocations
New 209 ns 736 B 13
Schema from struct 3.3 µs 15.2 KB 75
Build (3 ops) 8.0 µs 35.5 KB 211
MarshalJSON 18.7 µs 8.4 KB 38
MarshalYAML 33.1 µs 93.9 KB 482

Assessment: Performance is appropriate for typical API generation use cases. JSON marshaling is ~2x faster than YAML, which is expected.


🔒 Security Assessment

  • No obvious vulnerabilities: File operations use secure permissions
  • Input validation: The package relies on Go's type system rather than parsing user strings
  • No external data sources: Schema generation is from compile-time Go types
  • Proper error handling: Errors are accumulated and returned at build time

📊 Test Coverage Analysis

Coverage: 95.0% of statements

Test file analysis:

  • builder_test.go: 987 lines - Core builder functionality
  • reflect_test.go: 655 lines - Reflection engine with generic types, circular refs, embedded structs
  • operation_test.go: 357 lines - Operation options and parameters
  • tags_test.go: 447 lines - OAS tag parsing and application
  • example_test.go: 313 lines - Godoc examples (verified working)
  • builder_bench_test.go: 231 lines - Performance benchmarks

Observation: Test coverage is comprehensive and follows the project's requirement for testing all exported functionality.


📝 Minor Suggestions (Non-blocking)

  1. Consider adding ExternalDocs support at the document level - The builder supports externalDocs on tags but not on the document root

  2. Webhooks support for OAS 3.1+ - The package documentation mentions OAS 3.1 support, but webhooks (a 3.1 feature) are not supported. Consider adding AddWebhook() in a future iteration.

  3. Makefile target added correctly - The bench-builder target was added and integrates well with existing benchmark infrastructure


Conclusion

Recommendation: Approve with minor fix

This is a well-implemented, well-tested, and well-documented package that follows project conventions. The only action item is removing the unused hasName method (or adding a test for it).

The builder package provides a valuable addition for users who want to programmatically generate OpenAPI specifications in Go, with excellent reflection-based schema generation and type-safe OAS version handling.


🤖 Generated with Claude Code

@erraggy
Copy link
Copy Markdown
Owner

erraggy commented Nov 29, 2025

@copilot please address every issue and implement all suggestions posted in the most recent comment to this PR (#52: #52 (comment))

…ExternalDocs, AddWebhook

Co-authored-by: erraggy <366249+erraggy@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 29, 2025

@copilot please address every issue and implement all suggestions posted in the most recent comment to this PR (#52: #52 (comment))

Addressed all issues and implemented all suggestions from the code review in commit 9046384:

Issues Fixed:

  • Removed unused hasName method from schemaCache (per CLAUDE.md guidelines to delete unused code)
  • Added FromOAS2Document for OAS 2.0 document parity with FromDocument

Enhancements Added:

  • SetExternalDocs() for document-level external documentation (both OAS 2.0 and 3.x)
  • AddWebhook() for OAS 3.1+ webhooks support
  • Updated doc.go with comprehensive documentation for all new features

Documentation Updates:

  • Added note about OpenAPI requiring at least one response per operation in the AddOperation godoc
  • Added sections in doc.go for:
    • Modifying existing documents (FromDocument/FromOAS2Document)
    • Webhooks (OAS 3.1+)
    • External documentation
    • Operation response requirements

Co-authored-by: erraggy <366249+erraggy@users.noreply.github.com>
Copy link
Copy Markdown
Owner

@erraggy erraggy left a comment

Choose a reason for hiding this comment

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

I have requested changes in in-line comments throughout, please address all @copilot.

Comment thread builder/response.go Outdated
Comment thread builder/operation.go Outdated
Comment thread builder/operation.go Outdated
Comment thread builder/security.go Outdated
Comment thread builder/builder.go Outdated
Comment thread builder/builder.go Outdated
Comment thread builder/builder.go Outdated
Comment thread builder/reflect.go Outdated
Comment thread builder/reflect.go
…alidation

Co-authored-by: erraggy <366249+erraggy@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 29, 2025

I have requested changes in in-line comments throughout, please address all @copilot.

Addressed all issues in commit d1cf2d1:

  1. ✅ Replaced AddResponseWithContentType with WithResponseContentType option
  2. ✅ Moved responseConfig/ResponseOption to response.go
  3. ✅ Moved paramConfig/ParamOption to parameter.go
  4. ✅ Moved tagConfig/TagOption to tags.go
  5. ✅ Removed Build() that returns any
  6. ✅ Removed NewOAS2/NewOAS3, kept single New() constructor
  7. ✅ Removed validation, documented to use validator package
  8. ✅ Removed exported SchemaFrom/SchemaFromType
  9. ✅ Fixed nil dereference for embedded structs

All tests pass with 94.8% coverage.

Co-authored-by: erraggy <366249+erraggy@users.noreply.github.com>
Copilot AI requested a review from erraggy November 29, 2025 05:24
@erraggy erraggy merged commit b5dd575 into main Nov 29, 2025
7 checks passed
@erraggy erraggy deleted the copilot/implement-builder-package branch November 29, 2025 05:24
erraggy added a commit that referenced this pull request Nov 29, 2025
Fixes two documentation issues:

1. README.md line 158: Updated builder example to use BuildOAS3() instead of
   the removed Build() method. The Build() method was removed in PR #52 in
   favor of type-specific BuildOAS2() and BuildOAS3() methods.

2. doc.go: Updated package count from five to six packages to include the
   new builder package added in v1.12.0.

These changes ensure documentation accuracy on pkg.go.dev and in the README.
erraggy added a commit that referenced this pull request Nov 29, 2025
Fixes two documentation issues:

1. README.md line 158: Updated builder example to use BuildOAS3() instead of
   the removed Build() method. The Build() method was removed in PR #52 in
   favor of type-specific BuildOAS2() and BuildOAS3() methods.

2. doc.go: Updated package count from five to six packages to include the
   new builder package added in v1.12.0.

These changes ensure documentation accuracy on pkg.go.dev and in the README.
erraggy added a commit that referenced this pull request Nov 29, 2025
Fixes two documentation issues:

1. README.md line 158: Updated builder example to use BuildOAS3() instead of
   the removed Build() method. The Build() method was removed in PR #52 in
   favor of type-specific BuildOAS2() and BuildOAS3() methods.

2. doc.go: Updated package count from five to six packages to include the
   new builder package added in v1.12.0.

These changes ensure documentation accuracy on pkg.go.dev and in the README.
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.

3 participants