v0.5.1
Added
- Logger debug feature for tracing spec generation behavior.
InterceptSchemaandInterceptPropreflector hooks for customizing schema and property generation.RequiredPropByValidateTaghook for marking fields required based onvalidatestruct tags.ParentTypefield onInterceptPropParamsfor richer hook context.- Automatic content-type detection from struct type when not explicitly set.
encoding.TextMarshaler/TextUnmarshalersupport: types implementing both interfaces (withoutjson.Marshaler) are reflected astype: string.EmbedReferencerinterface andrefer:"true"struct tag: embedded structs opt intoallOf $refinstead of field inlining.ParameterTagMappingnow acceptsopenapi.ParameterInBodyandopenapi.ParameterInFormto override the struct tag used for JSON and form request body field names (defaults:jsonandform).
Changed
- Schema component names now always include the Go package name as a prefix (e.g.,
models.User→ModelsUser). This eliminates cross-package naming collisions without requiring caller-package detection. UseInterceptDefNameorStripDefNamePrefixto remove the prefix if desired. DefNameCallerPkgfield removed fromReflectorConfig; the caller-package detection mechanism inNewGeneratoris removed.- Package name sanitization handles multi-segment names (e.g.,
spec_test→SpecTest); unexported type names are title-cased when a package prefix is prepended.
Fixed
uint8/uint16reflected asint32format;uint/uint32/uint64/uintptrreflected asint64format.InterceptSchema/InterceptProphook error propagation and correctness.RefSchemapre-hook: assignStructSchemafields onto existing pointer so pre-hook customizations (extensions, description) survive to the post-hook.ApplyNullable(OAS 3.1+): merge"null"into an existing[]stringtype slice instead of silently skipping.- Lint violations and YAML tag reading in
MarshalYAML.
Full Changelog: v0.5.0...v0.5.1