Commit Graph

35 Commits

Author SHA1 Message Date
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
Dave Shanley
916b6d410d Extraction functions now at 100% coverage.
Model builder is up next.
2022-08-29 16:19:37 -04:00
Dave Shanley
8a4bf811ba Working throught testing for extraction functions.
boring, but important.
2022-08-29 09:15:36 -04:00
Dave Shanley
8241d834ed Back porting updated schema coverage
ensuring circular references are handled. schemas won't ever care as they are always proxied.
2022-08-28 14:56:27 -04:00
Dave Shanley
2398f051b8 building out tests for extraction functions.
Same functions will power every other model. Found some opprotunities to add control over circular references, when and how to fire errors and what not. All in all, some robust code additions will improve the library significantly.
2022-08-28 13:21:57 -04:00
Dave Shanley
61a1317ffd Building out extraction and location code.
adding tests to extactraction functions.

Signed-off-by: Dave Shanley <dave@quobix.com>
2022-08-27 13:21:20 -04:00
Dave Shanley
c34c4f668c Massive refactor on how the library handles schemas.
Schemas are now rendered on demand. There is no reasonable way to navigate the mayhem that is circular dependencies through multiple inheritance and polymorphism. So now using a msuch simpler design (and MUCH faster), there is a `SchemaProxy` for every schema reference. This holds a reference to the low model and index, that renders the schema on demand. Once rendered, it's done. Any children can also be rendered on demand, and so down the rabbit hole you do (if you want).

All circular dependencies are know by the index, so you can decide when you want to stop, or just keep going for ever, however it's now a choice, not something decided for you.

Signed-off-by: Dave Shanley <dave@quobix.com>
2022-08-27 09:47:37 -04:00
Dave Shanley
1a71f449ff Huge performance increase with building.
Using some designs unearthed from building the higher level model, I have brough that design down to the lower level to speed things up. It only took 8 years, but finally, I think I have mastered mult-threading. No more deadlocks, and no more need for waitgroups for everything.
2022-08-22 09:46:44 -04:00
Dave Shanley
75c7c83e31 Bumping coverage on schema to 100%
I think it should be pretty much bullet proof at the moment (until the next failure). Also added external index lookups from main index for external docs. found this bug after refining lookups in schemas.
2022-08-17 08:09:01 -04:00
Dave Shanley
10bf40ad97 Paths test coverage is completed.
Found some good gaps a holes in existing overage.
2022-08-15 17:52:32 -04:00
Dave Shanley
1d77840470 Test coverage bump 2022-08-14 05:29:37 -04:00
Dave Shanley
67c701ff07 Refactoring extraction and builder functions.
now things are robust, we can move things around a little to prepare for the next set of incoming models. The extraction and builder functions have all been moved to the low packakge, and out of the v3 package.
2022-08-14 04:03:13 -04:00
Dave Shanley
acee81f126 Added external doc test 2022-08-14 04:00:11 -04:00