pb33f / libopenapi

libopenapi is a fully featured, high performance OpenAPI 3.1, 3.0 and Swagger parser, library, validator and toolkit for golang applications.
https://pb33f.io/libopenapi/
Other
470 stars 64 forks source link

Add support for Document Hashing #321

Open ThomasRooney opened 2 months ago

ThomasRooney commented 2 months ago

Being able to Hash() an openapi document and get back a stable checksum (i.e. regardless of indentation changes) would be very useful.

I see this function here, and would love for it to be enabled? What's the known gap?

https://github.com/pb33f/libopenapi/blob/c3eb16d4e482e8c432b50bfc66ef28fb7a9514fb/datamodel/low/v3/document.go#L119C4-L121

daveshanley commented 2 months ago

Something is not hashing (or was not hashing) consistently.

I have not checked and I did not have time to debug it, so I froze the code in stone, for another time when I had the opportunity.