Skip to content

Conversation

@jpobst
Copy link
Contributor

@jpobst jpobst commented Jun 28, 2022

Fixes #976.

Given an api.xml element like:

<package name='my.package'>
  <class name='MyClass' api-since='29' />
</package>

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

<remove-attr path='/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:

<package name='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.

@jpobst jpobst modified the milestone: 7.0.0 Jun 28, 2022
@jpobst jpobst marked this pull request as ready for review June 28, 2022 15:55
@jonpryor jonpryor merged commit 7f1d2d7 into main Jun 30, 2022
@jonpryor jonpryor deleted the remove-attr branch June 30, 2022 20:36
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
Sign up for free to 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

3 participants