Skip to content

fix(panko): support Panko 1.0 - #139

Merged
skryukov merged 1 commit into
skryukov:mainfrom
ansdelft:panko-1.0
Nov 16, 2026
Merged

skryukov merged 1 commit into
skryukov:mainfrom
ansdelft:panko-1.0

Conversation

@benjaminwols

Copy link
Copy Markdown
Contributor

Panko 1.0 replaced its C extension with a code-gen engine. Serializer instances no longer have the @descriptor the plugin read, so generating types fails:

NoMethodError: undefined method 'attributes' for nil
  typelizer/serializer_plugins/panko.rb:8:in 'properties'

Panko 1.0 adds a public, read-only Panko::Descriptor for introspection. The plugin now reads that when it exists, and keeps the old path for Panko < 1.0.

  • Associations keep the has_many-before-has_one order of Panko < 1.0, so existing generated types and OpenAPI schemas don't reorder on upgrade. Panko 1.0 lists them in declaration order.
  • Attribute and association names are converted to strings, as Panko < 1.0 returned them.

Panko 1.0 needs Ruby >= 3.4 and Rails >= 7.2, and the test app pins Rails 7.1. So Gemfile reads PANKO_VERSION and RAILS_VERSION from the environment, and CI gets an extra Ruby 4.0 job on Panko 1.0 and Rails 7.2. The other jobs still resolve Panko 0.8.5.

The full suite passes on Panko 0.8.5 (Rails 7.1) and Panko 1.0.0 (Rails 7.2) with no snapshot changes.

🤖 Generated with Claude Code

Panko 1.0 replaced its C extension with a code-gen engine, and serializer
instances no longer have the @descriptor the plugin read, so generation
failed with "undefined method 'attributes' for nil". Read the public
Panko::Descriptor instead when it exists, and keep the old path for
Panko < 1.0.

Associations keep the has_many-before-has_one order of Panko < 1.0 so
generated types don't reorder on upgrade.

CI gets a Ruby 4.0 job on Panko 1.0, which needs Rails >= 7.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@skryukov
skryukov merged commit c73a4bc into skryukov:main Nov 16, 2026
8 checks passed
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.

2 participants