You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf(validator,fixer,builder,joiner): migrate to pathutil for ref string building (#289)
* perf(validator,fixer,builder): migrate to pathutil for ref string building
Replace fmt.Sprintf and inline string concatenation with centralized
pathutil reference builders across validator, fixer, and builder packages.
Changes:
- validator/refs.go: Replace 14 fmt.Sprintf calls with pathutil functions
- fixer/refs.go: Replace helper functions and inline concatenations with pathutil
- fixer/stub_missing_refs.go: Use pathutil for prefix constants and descriptions
- fixer/generic_names.go: Use pathutil constants in extractSchemaNameFromRefPath
- builder/parameter.go: Replace parameterRefPrefix with pathutil.ParameterRef
- builder/response.go: Replace responseRefPrefix with pathutil.ResponseRef
Benefits:
- Eliminates ~40 fmt.Sprintf/string concat calls
- Removes 2 duplicate helper functions
- Replaces 14+ hardcoded prefix strings with constants
- Centralizes all OAS reference path logic in internal/pathutil
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* perf(joiner): migrate to pathutil for ref string building
- Use pathutil.DefinitionRef/SchemaRef in schemaRefPath()
- Use pathutil constants in extractSchemaName()
- Modernize to strings.CutPrefix for cleaner prefix extraction
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
0 commit comments