Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calc path in title next to anchorID #350

Merged
merged 3 commits into from Apr 10, 2024
Merged

calc path in title next to anchorID #350

merged 3 commits into from Apr 10, 2024

Conversation

sebhoss
Copy link
Contributor

@sebhoss sebhoss commented Mar 30, 2024

So I cannot quite explain it but this change fixes wrong path expressions in titles. I am guessing that Go's weird loop/pointer mechanics are at play here, but I failed to figure out where/why/how this is happening in this case.

Since the calculated anchorID is always correct, I've simply moved the calculation of the path title right next to it and everything immediately worked as expected.

As you can see in the testdata change, this bug has been around for a while and probably affects many providers in the ecosystem.

Fixes #285

@sebhoss sebhoss requested a review from a team as a code owner March 30, 2024 10:29
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 30, 2024

CLA assistant check
All committers have signed the CLA.

Fixes hashicorp#285

Signed-off-by: Sebastian Hoß <seb@xn--ho-hia.de>
@sebhoss
Copy link
Contributor Author

sebhoss commented Apr 5, 2024

Rebased on latest main

Copy link
Contributor

@SBGoods SBGoods left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sebhoss
Thank you for taking the time to look into to this! The code in the schemamd package is a bit convoluted but I think you're probably right that this likely caused by Go looping mechanics.

I've added an acceptance test and a changelog entry, but otherwise the PR looks good to me. Thanks again!

@SBGoods SBGoods merged commit ab779d3 into hashicorp:main Apr 10, 2024
3 checks passed
@SBGoods SBGoods added this to the v0.19.0 milestone Apr 10, 2024
@SBGoods SBGoods added bug Something isn't working command/generate labels Apr 10, 2024
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working command/generate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SchemaMarkdown contains wrong nested attribute titles
3 participants