This function was re-written in order to fix a number of performance issues with the original implementation.
Allocations were high and this function is used a lot, this new implementation is much
lighter on string allocations by using a string builder.
And added deeper support for Aliases. Also added in local file handling through renamed `FSHandler` configuration property for the index.
Also re-ran `go fmt`
Signed-off-by: Dave Shanley <dave@quobix.com>
Fixing some outdated code as well.
Signed-off-by: Dave Shanley <dave@quobix.com>
Cleaning up more coverage issues
Signed-off-by: Dave Shanley <dave@quobix.com>
More test coverage updates.
Signed-off-by: Dave Shanley <dave@quobix.com>
Now the original indention is captured and string delimiters are retained when rendering out documents.
Signed-off-by: Dave Shanley <dave@quobix.com>
# fixes 106
Original input document types are now rendered automatically as JSON or YAML (vs always being YAML). This only operates at the `Document` level for rendering out entire documents.
Requested in #105
Signed-off-by: Dave Shanley <dave@quobix.com>
In vacuum, a usecase was reported where an infinite loop occurred due to re-parsing the same reference over and over in a loop. It was re-creatable and it was because the loop happened before the index was ready.
This should be resolved now, at least for this use case. To be sure, I have included the specs as a new test.
https://github.com/daveshanley/vacuum/issues/268
Signed-off-by: Dave Shanley <dave@quobix.com>
This patch bumps up support for creating valid JSON paths from references. It addresses #48 and makes invalid specs, valid! This addresses issues #48 and #45 that report references cannot be found. Now `libopenapi` can support much more funky lookups.
The case checking seems kinda dumb now looking back at this code. I am not sure why I felt the need to do that, however after being aware of it for some time and not being happy with the extra cycles it puts the code through.
This change removes ConvertCase from the utils package, as it's no longer used or needed right now. If it needs co come back, we can re-add the code, but deleting code always makes me happy.
It also removed a dependency from the project, which reduces the footprint, great!
A single line that tries to read an HTTP response body and fails is very hard to test without mocking, and the mock does not add value to a single line of code to check for an error that can rarely ever be triggered. Going to settle for 99.9% for now.