Skip to content

Align configuration with documented behavior - #53

Merged
mcncl merged 1 commit into
mainfrom
fix/configuration_behavior
Oct 27, 2026
Merged

mcncl merged 1 commit into
mainfrom
fix/configuration_behavior

Conversation

@mcncl

@mcncl mcncl commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Description

Configuration files currently accept options that generation ignores, and schema mode bypasses supported customization. Honor supported options in both modes and report unsupported settings instead of silently accepting them.

Type of Change

  • Bug fix
  • Breaking change: invalid or enabled unsupported settings now return errors
  • Documentation update
  • Test improvements

Changes Made

  • Apply naming, type mappings, tag customization, pointer control, and array naming in sample and schema generation. Preserve nullable array elements, map values, and recursive schema pointers when optional field pointers are disabled.
  • Let explicit CLI values override configuration, including --package=main, --root-name=RootType, and --format=true.
  • Reject unknown YAML keys, multiple documents, unsupported tag formats, and enabled dormant options. Keep inactive compatibility defaults accepted and warn about deprecated force_int64 and date_format settings.
  • Align the README and example configuration with supported behavior and clear the existing lint findings without changing generated output.

Testing

  • go test -race -count=1 ./... passed, including generated-code compilation and JSON decoding, CLI precedence, and configuration diagnostics.
  • go vet ./... and Staticcheck v0.8.2 passed.
  • make lint with golangci-lint v2.15.0: 0 issues.
  • gofmt -s -l . and git diff --check: no findings.

Configuration Changes and Documentation

  • Updated configuration validation
  • Updated example configuration
  • Updated README and compatibility guidance

Breaking Changes

Older files with misspelled keys or enabled unsupported settings now fail with migration advice. Remove those settings or use the accepted inactive defaults documented in the README. Constructors, String methods, custom headers, and debug logging are not implemented; gofumpt can run separately. Object samples always merge.

types.force_int64 and types.date_format remain accepted no-ops with CLI warnings. --debug=true now returns an error instead of silently doing nothing.

Honor supported customization in sample and schema generation, and
let explicit CLI values override configuration defaults. Reject unknown
and unsupported settings instead of silently ignoring them, while
warning about retained legacy no-ops.

Document the compatibility policy, cover generated-code decoding and
CLI precedence, and clear existing lint findings.
@mcncl
mcncl enabled auto-merge (squash) October 27, 2026 09:12
@mcncl
mcncl merged commit 5f9cbc6 into main Oct 27, 2026
5 checks passed
@mcncl
mcncl deleted the fix/configuration_behavior branch October 27, 2026 09:14
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