Skip to content

Fix/loader conformance - #129

Merged
fredbi merged 2 commits into
go-openapi:masterfrom
fredbi:fix/loader-conformance
Aug 21, 2026
Merged

Fix/loader conformance#129
fredbi merged 2 commits into
go-openapi:masterfrom
fredbi:fix/loader-conformance

Conversation

@fredbi

@fredbi fredbi commented Aug 21, 2026

Copy link
Copy Markdown
Member

Change type

Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update

Short description

Fixes

Full description

Checklist

  • I have signed all my commits with my name and email (see DCO. This does not require a PGP-signed commit
  • I have rebased and squashed my work, so only one commit remains
  • I have added tests to cover my changes.
  • I have properly enriched go doc comments in code.
  • I have properly documented any breaking change.

fredbi and others added 2 commits August 21, 2026 20:59
go1.27 enables encoding/json v2 by default, which makes RawMessage an alias
of encoding/json/jsontext.Value. Unaliasing a field written as
json.RawMessage now lands on jsontext.Value, and two rules keyed on the old
spelling stopped firing:

- resolvers.IsStdJSONRawMessage read only (encoding/json, RawMessage), so
  the type fell through to its []byte underlying and rendered as an array of
  uint8 instead of the empty "any JSON" schema. It answers to both names.
- namedWrittenRHS, the responses builder's redirect onto the layer a
  declaration was written over, demanded a *types.Named there.
  `type DefinedRaw json.RawMessage` writes an alias, so the redirect
  declined and the response carried the same array. It unaliases before
  testing for a declared type, and hands the alias itself on so the
  declaration's alias policy still applies.

The response-specials fixture gains the spelling that reaches the second one
without go1.27 — `type ViaAliasStamp Stamped` over a local alias of
time.Time, which came out with no schema at all.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
The go1.27 uuid suite still asserted that an embedded uuid.UUID is dropped
with an unsupported-type warning. embedPromotes changed that: an embed over
an array promotes no member, so it becomes an ordinary property named after
the type, and Embedder now carries UUID: {string, uuid} beside name. The
sub-test, the fixture prose and go127_uuid_spec.json say so, as does the
paragraph in schema/README.md that still described the drop.

The expectation went unchecked for as long as it did because the suite is
behind //go:build go1.27 and does not compile before it.

Nothing here moves the decision on a promoted MarshalText: a struct
embedding one still emits an object.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
@fredbi
fredbi merged commit 8c0bd2a into go-openapi:master Aug 21, 2026
32 checks passed
@fredbi
fredbi deleted the fix/loader-conformance branch August 21, 2026 19:50
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