Skip to content
This repository was archived by the owner on Jul 6, 2026. It is now read-only.

[generator] Fix <remove-attr> metadata. - #999

Merged
jonpryor merged 1 commit into
mainfrom
remove-attr
Jun 30, 2022
Merged

[generator] Fix <remove-attr> metadata.#999
jonpryor merged 1 commit into
mainfrom
remove-attr

Conversation

@jpobst

@jpobstjpobst commented Jun 28, 2022

Copy link
Copy Markdown
Contributor

Fixes#976.

Given an api.xml element like:

<packagename='my.package'>
<classname='MyClass'api-since='29' />
</package>

You would expect to be able to remove the api-since attribute with this metadata:

<remove-attrpath='/api/package[@name='my.package']/class[@name='MyClass']'name='api-since' />

However, even though generator reads the name attribute, it then proceeds to ignore it and remove all attributes on the matched node, resulting in:

<packagename='my.package'>
<class />
</package>

This seems unintuitive, and I'm not sure how this could ever be successfully used in a binding project, since leaving an empty <class>, etc. node causes generator to crash.

Fix <remove-attr> to work as expected.

@jpobstjpobst modified the milestone: 7.0.0Jun 28, 2022
@jpobst
jpobst marked this pull request as ready for review June 28, 2022 15:55
@jonpryor
jonpryor merged commit 7f1d2d7 into mainJun 30, 2022
@jonpryor
jonpryor deleted the remove-attr branch June 30, 2022 20:36
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Apr 12, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metadata <remove-attr> doesn't work as expected

2 participants

@jpobst@jonpryor