-
Notifications
You must be signed in to change notification settings - Fork 82
Stabilized render of REST HTML #1896
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
Conversation
|
|
||
| class HashExtension extends AbstractExtension | ||
| { | ||
| private $hashes = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible for us to force higher PHP version here and use its features, like strict type in this case? I'd go for the latest PHP 8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically possible, it's an internal tool.
Well, copied from an open source library afaik.
However, I'm not sure what versions of PHP our doc team have, and I'm not sure if we can just force PHP 8. PHP 7.4 would be more suitable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose #1898 as quick fix for PHP 7.4 as it doesn't work with 7.2 anymore.
For PHP 8.1+, I'll make a survey.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're all good with at least PHP 8.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this w/ 7.4 and I'll continue my 8.1 PR afterward.
* Stabilized render of REST HTML * raml2html: Upgrade to PHP 7.4 (#1898)
* Stabilized render of REST HTML * raml2html: Upgrade to PHP 7.4 (#1898)
This PR ensures that HTML generated for REST API documentation remains the same across multiple re-renders.
What it basically does, it replaces the
uuidfunction usage withhashfunction. Since the context provided to the hashing function does not change, it ensures that each and every time the same ID string is generated.What we will need to see is if we ever encounter the same hash twice, as that would mean we have the same context in multiple locations. To prevent collision, all hashes are stored and rendering will fail if the same hash is generated twice.
Checklist