Skip to content

Blueprint inheritance #290

@rsamoilov

Description

@rsamoilov

When a blueprint subclasses another blueprint (not Blueprinter::Base itself), resolve the parent class using the same file-discovery strategy and merge its fields into the child's schema. A child re-declaring a field with a different name: wins. Guard against circular inheritance.

class AdminBlueprint < UserBlueprint
  field :access_level
  # inherits uuid, email, first_name, last_name
end

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions