Commit Graph

62 Commits

Author SHA1 Message Date
quobix
ce6b9b9470 Added windows support, all tests pass now. 2024-01-18 15:11:39 -05:00
Tristan Cartledge
6904f4d459 fix: cleanup tests 2023-12-03 20:41:54 +00:00
Tristan Cartledge
94fb310643 fix: tests 2023-12-01 18:25:15 +00:00
Tristan Cartledge
a4ad09aab3 fix: continued moving everything to orderedmaps plus cleaned up most the tests 2023-12-01 17:37:07 +00:00
Tristan Cartledge
2de65e4ca0 Merge branch 'main' into Baliedge/PIP-2552-consistent-ordering 2023-11-27 12:06:39 +00:00
quobix
95338f2536 More tuning and working on vacuum support
noticed a couple of stange things with vacuum

Signed-off-by: quobix <dave@quobix.com>
2023-11-25 10:10:51 -05:00
quobix
ac96579355 re-fixed the issue for real.
a little more reflection was required to make it work correctly.

Signed-off-by: quobix <dave@quobix.com>
2023-11-17 16:44:01 -05:00
quobix
43838b8f25 Removed reflection check
blowing up tests for no real good reason, not required anyway

Signed-off-by: quobix <dave@quobix.com>
2023-11-17 07:08:09 -05:00
quobix
ac80716553 A few small bugfixes discovered from online users of openapi-changes
someone caused a panic, exposed an untested bug.

Signed-off-by: quobix <dave@quobix.com>
2023-11-17 07:08:09 -05:00
quobix
54f4c82007 More coverage tuning and cleaning
Signed-off-by: quobix <dave@quobix.com>
2023-11-04 10:03:43 -04:00
quobix
f3094d0b14 Cleanup, sweep-up and tuneup
Signed-off-by: quobix <dave@quobix.com>
2023-11-04 09:38:33 -04:00
quobix
7d8762fdd9 added more coverage and resolved param ref issue
Signed-off-by: quobix <dave@quobix.com>
2023-11-03 18:25:27 -04:00
quobix
fde5a9972d tuning ref lookups, finding some gaps.
coverage will drop no doubt

Signed-off-by: quobix <dave@quobix.com>
2023-11-03 14:06:37 -04:00
quobix
78763fd48b cleaning up unreachable code.
Signed-off-by: quobix <dave@quobix.com>
2023-11-02 15:33:05 -04:00
quobix
a8a0e1d47f added context to schema buildout
model was failing on subschemas with refs, needed context

Signed-off-by: quobix <dave@quobix.com>
2023-11-02 10:47:31 -04:00
quobix
8bbb022daa Addressed comments from review and fixed bug with schema props
props did not have context, therefore they had no idea where they were or where to resolve from.

Signed-off-by: quobix <dave@quobix.com>
2023-11-02 10:28:29 -04:00
quobix
ce4a60baa8 cleaning up the last few stragglers
Signed-off-by: quobix <dave@quobix.com>
2023-11-01 15:15:46 -04:00
quobix
701c77e1bf extraction functions coverage bumped back up
Signed-off-by: quobix <dave@quobix.com>
2023-10-31 18:20:02 -04:00
quobix
fec99623f3 ensuring we capture empty responses
Signed-off-by: quobix <dave@quobix.com>
2023-10-31 15:44:29 -04:00
quobix
6e9db7f838 A massive test update to bring everything inlne with the new Buildable signature.
All tests in index and datamodel now pass. The rolodex fixes all the things.

Signed-off-by: quobix <dave@quobix.com>
2023-10-23 18:18:44 -04:00
quobix
8717b3cd33 An enormous amount of surgery on the low level model.
Every `Build()` method now requires a `context.Context`. This is so the rolodex knows where to resolve from when locating relative links. Without knowing where we are, there is no way to resolve anything. This new mechanism allows the model to recurse across as many files as required to locate references, without loosing track of where we are in the process.

Signed-off-by: quobix <dave@quobix.com>
2023-10-23 15:04:34 -04:00
quobix
48c83ddb30 resolver tests all operational
time to start some cleanup.

Signed-off-by: quobix <dave@quobix.com>
2023-10-18 12:01:06 -04:00
quobix
511843e4df Major surgery on the index and resolver. A complete flip in design.
Signed-off-by: quobix <dave@quobix.com>
2023-10-14 12:36:38 -04:00
Shawn Poulson
f389fedadd Monster refactor of map to orderedmap.Map data type. 2023-09-25 08:59:42 -04:00
Dmitry
6c24cd5940 Pass the key node 2023-08-25 09:51:57 -04:00
Dave Shanley
f05abdbcb5 Fixed low-level bug that failed to deal with null/empty hashing.
Signed-off-by: Dave Shanley <dave@quobix.com>
2023-08-09 07:40:24 -04:00
Dave Shanley
25d8de9b0e Added more support for YAML merge nodes, anchors and aliases
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>
2023-07-16 11:45:18 -04:00
Dave Shanley
db27267e09 bumping test coverage, adding more tests.
Signed-off-by: Dave Shanley <dave@quobix.com>
2023-06-17 14:12:27 -04:00
Dmitry
fa337646da Use EqualFold ti avoid memory reallocations 2023-06-17 13:13:15 -04:00
Dave Shanley
230f8fdd02 Added new extraction functions to control extensions
New extraction functions added (that just wrap the old ones). The difference here is that the extensions can be included or ignored now. This has been added to address issue #24 where header keys can in fact include an extension prefix.

Signed-off-by: Dave Shanley <dave@quobix.com>
2023-05-17 09:38:18 -04:00
Dave Shanley
5d7f22fca7 first level testing for rending v3 model in place.
Now onto some hardening tests, lets re-render each spec after reading to check for failures.
2023-03-26 06:10:31 -04:00
Dave Shanley
3101a7c9b7 Large update to support v3 rendering. 2023-03-26 06:10:31 -04:00
Dave Shanley
e6626fe22e Support for relative links now in place #73
Tests all passing, runs super fast, pulls in every single DigitalOcean spec and parses it. There may be some issues deeper down in the models, but for now high level tests all pass.
2023-02-22 09:14:27 -05:00
Dave Shanley
e19b7d2bf1 Working through fix #73
Quite a bit of surgery required.
2023-02-22 09:14:27 -05:00
Tristan Cartledge
e4c8bf4dbe fix: for low model reference values in arrays being set incorrectly 2023-02-02 05:15:04 -05:00
Dave Shanley
4706365744 Fixed tests that were using old signature.
Using new function, same old functionality.
2023-01-28 14:09:11 -05:00
Dave Shanley
05eb4ffec9 (patch): Some crazy references are causing panics. #48 #45
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.
2022-12-15 09:47:23 -05:00
Dave Shanley
d2a8379071 (fix): during testing found a missed case for #25
Forgot a section of code to add new feature to, just so happened to be the one I wasn't testing.

Signed-off-by: Dave Shanley <dave@quobix.com>
2022-12-03 12:59:27 -05:00
Dave Shanley
b5436e8d4e (feat): Added Reference tracking to low-level model #25
When building a document, everything that IS NOT a schema is auto-resolved in the model, this is very convenient because it creates a nice tree to explore and there is no need to perform lookups to when using `$ref` instead of inline definitions.

The issue is however being able to determine if the node was originally a reference or not, that data was lost, including the name of the reference used. This use case surfaced in issue #25, where the need to know what is and what is not referenced has different requirements for different applications.

This update now tracks that data and makes it available in `NodeReference` and `ValueReference` for every property.

Signed-off-by: Dave Shanley <dave@quobix.com>
2022-12-03 12:30:31 -05:00
Dave Shanley
1ce6a3b5e1 (fix): X- headers/non extensions being ignored. #24
In the olden days, long long ago, we used to mix up headers and extensions by using `X-` vs  `x-`. libopenapi was indiscriminate about case, which is an issue with legacy contracts.

This update is a non-breaking change that remedies this and resolves #24
2022-12-01 08:39:39 -05:00
Dave Shanley
97a03315d6 Smashing bugs in models by validating changes.
Who would have thought the what-changed tool would be the key to ensuring accuracy on the models.
2022-11-20 14:30:50 -05:00
Dave Shanley
d27e66ff3d Refactored SecurityRequirement **breaking change**
The v3 model is wrong and out of sync with the spec. It's been corrected, so the v2 and v2 model for SecurityRequirement have been collapsed down into a base model., they are the same data structures. This has allowed me to delete the complexity of sharing two different models for the same structure, by unifying the model correctly. I am not sure why I decided to change the v3 model, oh well, its been corrected. Long live swagger!
2022-11-18 11:00:34 -05:00
Dave Shanley
3bc0a3a577 v2 swagger scopes added to what-changed.
Added hashing functions to all v2 and v3 models that handle security, thats the next target.
2022-11-18 11:00:34 -05:00
Dave Shanley
b42e35f2b7 Wired up multi-version handling patterns
Designs for handling multiple versions of objects have been set, seems clean and scalable. Generic functions for handling maps has been added also, which will cut down time moving forward.
2022-11-18 11:00:34 -05:00
Dave Shanley
9cd7e4f155 Working through what changed rabbit hole
Parameter dependencies mean we're back in the ball of yarn stage. Coverage is going to drop for a bit, until all the new hashing and interfaces are in place.
2022-11-18 11:00:34 -05:00
Dave Shanley
fada7e5b09 Schema example checking is now in place.
Added generic hasing function for anything untyped.
2022-10-11 07:12:08 -04:00
Dave Shanley
4b9c5fba1e Building out schema comparison mechanism
Which has led to a new wider hashing capability for the low level API. hashing makes it very easy to determine changes quickly, without having to run comparisons to discover changes, could really speed things up moving forward.
2022-10-08 14:09:46 -04:00
Dave Shanley
65b242b6c4 Building out low level docs now
a long road ahead, but we must push forward.
2022-09-20 07:55:19 -04:00
Dave Shanley
2c4177e97a Swagger 2.0 high level model going in now
Shifting a few high level models around that are also shared. now it's just a churn game to flesh the high level model and test it up.
2022-09-09 07:08:52 -04:00
Dave Shanley
1814ac58eb V2 swagger model in place
tests being written to validate and flush out bugs
2022-09-03 13:30:53 -04:00