Skip to content

[WIP] [OpenAPI]: Blueprint inheritance#302

Draft
Abishekcs wants to merge 1 commit into
rage-rb:mainfrom
Abishekcs:openapi/blueprinter-inheritance
Draft

[WIP] [OpenAPI]: Blueprint inheritance#302
Abishekcs wants to merge 1 commit into
rage-rb:mainfrom
Abishekcs:openapi/blueprinter-inheritance

Conversation

@Abishekcs
Copy link
Copy Markdown
Contributor

@Abishekcs Abishekcs commented May 27, 2026

closes #290

What this PR does?

Add support for blueprint inheritance. Child blueprints now inherit fields from parent blueprints. A child re-declaring a field with a different name: takes priority over the parent's declaration.

Example Code

  • data_mining_base.rb
class DataMiningBase < Blueprinter::Base
  field :hello_world
  field :email
end
  • data_mining.rb
class DataMining < DataMiningBase
  identifier :uuid
  field :email, name: :login
  field :first_name
  • OpenAPI response output for # @response DataMining
{
  "hello_world": "string",
  "uuid": "string",
  "login": "string",
  "first_name": "string"
}

ScreenRecording

  • Before

  • After

- When a blueprint subclasses another blueprint (not Blueprinter::Base itself), parse the parent class and merge its fields into the child's schema.

- A child re-declaring a field with a different `name:` wins over the parent's original field declaration.
@Abishekcs Abishekcs changed the title [OpenAPI]: Blueprint inheritance [WIP] [OpenAPI]: Blueprint inheritance May 27, 2026
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.

Blueprint inheritance

1 participant