Skip to content

http: let derived classes inherit HtmxResponseAttribute - #105

Merged
rameel merged 1 commit into
mainfrom
response-attribute-inheritance
Oct 26, 2026
Merged

rameel merged 1 commit into
mainfrom
response-attribute-inheritance

Conversation

@rameel

@rameel rameel commented Oct 26, 2026

Copy link
Copy Markdown
Owner

No description provided.

HtmxResponseAttribute was declared with AttributeTargets.All and
Inherited = false, so it had no effect on a base controller or page
model and could be applied where it does nothing.

Restrict the attribute to classes and methods and make it inherited.
Allow one attribute per target: with AllowMultiple = true, MVC executed
the inherited attribute after the derived one, so the base class headers
won. The attribute of a derived class now replaces the inherited one.
Applying the attribute to other targets or more than once per target
is now a compile-time error.
@rameel
rameel merged commit 82b7f80 into main Oct 26, 2026
1 check passed
@rameel
rameel deleted the response-attribute-inheritance branch October 26, 2026 15:07
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