Skip to content

Add Blueprinter integration for Rage::OpenAPI#242

Open
sanithrshetty15 wants to merge 1 commit intorage-rb:mainfrom
sanithrshetty15:main
Open

Add Blueprinter integration for Rage::OpenAPI#242
sanithrshetty15 wants to merge 1 commit intorage-rb:mainfrom
sanithrshetty15:main

Conversation

@sanithrshetty15
Copy link

Summary

This PR adds static analysis support for the Blueprinter serializer
in Rage::OpenAPI, following the same pattern as the existing Alba integration.

Problem

Rage::OpenAPI currently only supports Alba serializers for auto-generating
OpenAPI schemas. Blueprinter is one of the most widely used Ruby serializers
but has no support — leaving those developers with no OpenAPI coverage.

Solution

A new parser Rage::OpenAPI::Parsers::Ext::Blueprinter that:

  • Parses Blueprinter class definitions using Prism AST (no runtime loading)
  • Supports field and identifier declarations
  • Supports association with nested blueprint resolution
  • Supports view blocks including named views like :extended
  • Supports collection wrapping via [BlueprintName] syntax
  • Includes circular reference protection via a parsing stack

Tests

10 RSpec tests added covering all major features:

  • Single and multiple fields
  • Identifier detection
  • Associations with and without blueprints
  • Default view isolation
  • Extended view with inherited fields
  • Collection wrapping
  • known_definition? detection

Checklist

  • Tests pass (1729 examples, 0 failures)
  • Follows existing Alba integration pattern
  • No runtime loading — pure static AST analysis

- Add Rage::OpenAPI::Parsers::Ext::Blueprinter parser
- Support field and identifier declarations
- Support associations with nested blueprint resolution
- Support view blocks including extended views
- Support collection wrapping
- Add circular reference protection via parsing stack
- Add 10 RSpec tests covering all major features
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