René's URL Explorer Experiment


Title: fix: autoload Engine when Rails loads after openapi_ruby by mortik · Pull Request #35 · openapi-ruby/openapi-ruby · GitHub

Open Graph Title: fix: autoload Engine when Rails loads after openapi_ruby by mortik · Pull Request #35 · openapi-ruby/openapi-ruby

X Title: fix: autoload Engine when Rails loads after openapi_ruby by mortik · Pull Request #35 · openapi-ruby/openapi-ruby

Description: Summary In hybrid mode (FRAMEWORK=hybrid), the generated subprocess script requires openapi_ruby/rspec and openapi_ruby/minitest at the top — both pull in lib/openapi_ruby.rb before Rails is loaded. The eager require_relative "openapi_ruby/engine" if defined?(Rails::Engine) then no-ops, so when the first spec file later requires rails_helper and Rails boots routes, mount OpenapiRuby::Engine raises NameError: uninitialized constant OpenapiRuby::Engine. Fall back to autoload :Engine, "openapi_ruby/engine" when Rails::Engine isn't yet defined at require time. The constant resolves lazily when routes reference it, by which point Rails has booted and class Engine < ::Rails::Engine works. Normal Rails boot still hits the eager path — Bundler.require runs after rails/all, so initializer registration timing is preserved. During schema generation the engine's middleware initializer is a no-op anyway (gated on OPENAPI_RUBY_GENERATING), so missing the initializer-collection window is harmless on the deferred path. Why this only bit hybrid mode The rspec-only script doesn't pre-require openapi_ruby/rspec — the user's openapi_helper.rb controls require order (typically rails_helper first). The hybrid script forces the bad order. Minitest-only would have the same problem but the user hadn't hit it. Test plan bundle exec rspec — 299/299 pass New regression spec spawns a subprocess simulating the bad load order — confirmed it fails with the exact NameError: uninitialized constant OpenapiRuby::Engine against the unfixed code, passes with the fix. 🤖

Open Graph Description: Summary In hybrid mode (FRAMEWORK=hybrid), the generated subprocess script requires openapi_ruby/rspec and openapi_ruby/minitest at the top — both pull in lib/openapi_ruby.rb before Rails is loade...

X Description: Summary In hybrid mode (FRAMEWORK=hybrid), the generated subprocess script requires openapi_ruby/rspec and openapi_ruby/minitest at the top — both pull in lib/openapi_ruby.rb before Rails is loade...

Opengraph URL: https://github.com/openapi-ruby/openapi-ruby/pull/35

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:0711a9ed-8282-c2b2-3f2e-b881e16b0a73
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA660:213839:1CC684B:24CA01F:6B014B7E
html-safe-nonce042bbbdefee4a76929970ff5c97506d8627159db8cb4a8e77c3dc497f6af9c66
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjYwOjIxMzgzOToxQ0M2ODRCOjI0Q0EwMUY6NkIwMTRCN0UiLCJ2aXNpdG9yX2lkIjoiMjgyNjcxODIyMzU1MzA4ODM4MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacee0431bb510a8055303b55dfbfd93c2d92eefd45b2b435be8e46a32b176dea88
hovercard-subject-tagpull_request:3832024496
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/openapi-ruby/openapi-ruby/pull/35/files
twitter:imagehttps://avatars.githubusercontent.com/u/517703?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/517703?s=400&v=4
og:image:altSummary In hybrid mode (FRAMEWORK=hybrid), the generated subprocess script requires openapi_ruby/rspec and openapi_ruby/minitest at the top — both pull in lib/openapi_ruby.rb before Rails is loade...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/openapi-ruby/openapi-ruby git https://github.com/openapi-ruby/openapi-ruby.git
octolytics-dimension-user_id276587259
octolytics-dimension-user_loginopenapi-ruby
octolytics-dimension-repository_id1211860664
octolytics-dimension-repository_nwoopenapi-ruby/openapi-ruby
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1211860664
octolytics-dimension-repository_network_root_nwoopenapi-ruby/openapi-ruby
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/openapi-ruby/openapi-ruby/pull/35/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenapi-ruby%2Fopenapi-ruby%2Fpull%2F35%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenapi-ruby%2Fopenapi-ruby%2Fpull%2F35%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=openapi-ruby%2Fopenapi-ruby
Reloadhttps://github.com/openapi-ruby/openapi-ruby/pull/35/files
Reloadhttps://github.com/openapi-ruby/openapi-ruby/pull/35/files
Reloadhttps://github.com/openapi-ruby/openapi-ruby/pull/35/files
openapi-rubyhttps://github.com/openapi-ruby
openapi-rubyhttps://github.com/openapi-ruby/openapi-ruby
Codehttps://github.com/openapi-ruby/openapi-ruby
Issues1 (1)https://github.com/openapi-ruby/openapi-ruby/issues
Pull requests2 (2)https://github.com/openapi-ruby/openapi-ruby/pulls
Actionshttps://github.com/openapi-ruby/openapi-ruby/actions
Projectshttps://github.com/openapi-ruby/openapi-ruby/projects
Security and qualityhttps://github.com/openapi-ruby/openapi-ruby/security
Insightshttps://github.com/openapi-ruby/openapi-ruby/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fopenapi-ruby%2Fopenapi-ruby%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fopenapi-ruby%2Fopenapi-ruby%2Fissues%2Fnew%2Fchoose
mortikhttps://github.com/mortik
mainhttps://github.com/openapi-ruby/openapi-ruby/tree/main
fix/engine-autoload-hybridhttps://github.com/openapi-ruby/openapi-ruby/tree/fix/engine-autoload-hybrid
Conversation 0 https://github.com/openapi-ruby/openapi-ruby/pull/35
Commits 1 https://github.com/openapi-ruby/openapi-ruby/pull/35/commits
Checks 12 https://github.com/openapi-ruby/openapi-ruby/pull/35/checks
Files changed https://github.com/openapi-ruby/openapi-ruby/pull/35/files
Please reload this pagehttps://github.com/openapi-ruby/openapi-ruby/pull/35/files
fix: autoload Engine when Rails loads after openapi_ruby https://github.com/openapi-ruby/openapi-ruby/pull/35/files#top
Show all changes 1 commit https://github.com/openapi-ruby/openapi-ruby/pull/35/files
4e19c55 fix: autoload Engine when Rails loads after openapi_ruby mortik Jun 9, 2026 https://github.com/openapi-ruby/openapi-ruby/pull/35/commits/4e19c55e2cf81b0de38b59b5fd3c1602dd8f194c
Clear filters https://github.com/openapi-ruby/openapi-ruby/pull/35/files
Please reload this pagehttps://github.com/openapi-ruby/openapi-ruby/pull/35/files
Please reload this pagehttps://github.com/openapi-ruby/openapi-ruby/pull/35/files
openapi_ruby.rb https://github.com/openapi-ruby/openapi-ruby/pull/35/files#diff-0fbcaf3b19e6b188cc0f2c997f6f2093bb139341fbba3d29e124cfcda137e115
engine_spec.rb https://github.com/openapi-ruby/openapi-ruby/pull/35/files#diff-d4b91c132b4cdc47642a5121d61bbdaca025b175d09e1bb617e6024451d05aee
lib/openapi_ruby.rbhttps://github.com/openapi-ruby/openapi-ruby/pull/35/files#diff-0fbcaf3b19e6b188cc0f2c997f6f2093bb139341fbba3d29e124cfcda137e115
View file https://github.com/openapi-ruby/openapi-ruby/blob/4e19c55e2cf81b0de38b59b5fd3c1602dd8f194c/lib/openapi_ruby.rb
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-ruby/openapi-ruby/pull/35/{{ revealButtonHref }}
https://github.com/openapi-ruby/openapi-ruby/pull/35/files#diff-0fbcaf3b19e6b188cc0f2c997f6f2093bb139341fbba3d29e124cfcda137e115
spec/openapi_ruby/engine_spec.rbhttps://github.com/openapi-ruby/openapi-ruby/pull/35/files#diff-d4b91c132b4cdc47642a5121d61bbdaca025b175d09e1bb617e6024451d05aee
View file https://github.com/openapi-ruby/openapi-ruby/blob/4e19c55e2cf81b0de38b59b5fd3c1602dd8f194c/spec/openapi_ruby/engine_spec.rb
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openapi-ruby/openapi-ruby/pull/35/{{ revealButtonHref }}
https://github.com/openapi-ruby/openapi-ruby/pull/35/files#diff-d4b91c132b4cdc47642a5121d61bbdaca025b175d09e1bb617e6024451d05aee
Please reload this pagehttps://github.com/openapi-ruby/openapi-ruby/pull/35/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.