Commit Graph

39 Commits

Author SHA1 Message Date
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
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
faf191bdd0 bumped coverage on tests
Signed-off-by: quobix <dave@quobix.com>
2023-10-08 12:27:52 -04:00
Tristan Cartledge
8531113e17 fix!: fixed handling of additionalProperties to handle the bool/json-schema nature better 2023-10-05 09:31:16 -04:00
Shawn Poulson
f389fedadd Monster refactor of map to orderedmap.Map data type. 2023-09-25 08:59:42 -04:00
quobix
53a46f4c60 Added SchemaProxy mutex #163
Rendering causes bits to be set on structs in the model. Concurrency causes race issues with reading a writing of these bits, as there is no locking in the model.

Until now. locking prevents concurrent renders that use a shared model from conflicting with one another.

Addresses #163 and https://github.com/pb33f/libopenapi-validator/issues/23

Signed-off-by: quobix <dave@quobix.com>
2023-09-18 17:50:33 -04:00
Dmitry
2042152318 Fix the tests 2023-08-25 09:51:57 -04:00
Dave Shanley
c3cf5f1e38 Added support for unevaluatedProperties as Schema and bool #118
Also ran `gofmt` across the entire project. Things need cleaning up.

Signed-off-by: Dave Shanley <dave@quobix.com>
2023-06-17 14:12:27 -04:00
Derrick J. Wippler
a09916eb67 fix: Schema.Minimum and Schema.Maxmium are now float64 2023-06-17 13:12:50 -04:00
Dave Shanley
1f9a8bd185 Schema tests updated with fixes.
Signed-off-by: Dave Shanley <dave@quobix.com>
2023-04-30 09:01:15 -04:00
Dave Shanley
3055711f24 Added support for libopenapi-validator and bumped coverage.
Non breaking changes add support for the new `libopenapi-validator` module.

Signed-off-by: Dave Shanley <dave@quobix.com>
2023-04-22 09:50:44 -04:00
Dave Shanley
10374e801b Adding support for libopenapi-validator
Signed-off-by: Dave Shanley <dave@quobix.com>
2023-04-22 09:50:44 -04:00
Tristan Cartledge
99bf12c1c7 feat: add attribute to schema model 2023-04-18 05:22:49 -04:00
Dave Shanley
bc5a020c7a Hardening is uncovering a few rough edges.
Some missing bits here and there are being picked up by the diff engine in tests. Working through each rough edge, one at a time.
2023-03-26 06:10:31 -04:00
Dave Shanley
5189eadddc Large refactor and addedGetAllChanges to each change
tons of updates, so many things.
2023-03-26 06:10:31 -04:00
Dave Shanley
0e8ae7c548 rendering complex additionalProperties in place.
slices of maps were not rendered properly. Now corrected, coverage continues to rise, refactoring node generation into utils package.
2023-03-26 06:10:31 -04:00
Dave Shanley
0e44dc90b5 Working through coverage on node builder. 2023-03-26 06:10:31 -04:00
Dave Shanley
000eada3f4 more mutable objects, more tightening up 2023-03-26 06:10:31 -04:00
Dave Shanley
38064123ed Working through complex rendering edgecases. 2023-03-26 06:10:31 -04:00
Dave Shanley
da17b8df89 Tackled the boss, schemas! now mutable.
A tricky one, because of the complexity, still working through edge cases and variations, but so far, operating correctly!
2023-03-26 06:10:31 -04:00
Daniel G. Taylor
de1a42c72f fix: DynamicValue in high model schema missing N value 2023-01-21 06:05:23 -05:00
Tristan Cartledge
52f9868d96 fix: fix handling of ordered arrays when processing them async 2023-01-10 17:39:03 -05:00
Dave Shanley
64887b53b1 (fix): fixed low-level *SchemaProxy high-level additionalProperties #29
When `additionalProperties` is a map, it's treated as a SchemaProxy in the low-level model. This proxy was being incorrectly lifted up into the high-model.
2022-12-12 09:31:35 -05:00
Dave Shanley
3fd088b217 Increased coverage for model back to 100% 2022-12-09 07:06:34 -05:00
Dave Shanley
b3f0a0b1ae Working on model changes to resolve #38 and #28 **breaking change**
Also adding in other properties to schema that are missing. Test coverage still needs improving and this is a breaking change to low and high models.
2022-12-09 07:06:34 -05:00
Dave Shanley
d51d2fcd27 Added contains, minContains and maxContains to schema #28
Added support for missing 3.1 schema properties, however it does not cover the `boolean` case
2022-12-09 07:06:34 -05:00
Dave Shanley
cbfb051a92 (feat): Schema now has pointer back to SchemaProxy #29
The 'owning' `SchemaProxy` is now trackable back from a `Schema` part of the conversations happening on #29
2022-12-05 12:18:10 -05:00
Dave Shanley
ee93996ff2 (feat): added new BuildSchema method to suppliment Schema #31
A new `BuildSchema()` method does the same thing as `Schema()` but simply returns the build error along with the schema, so error checking can be performed inline when required.

Signed-off-by: Dave Shanley <dave@quobix.com>
2022-12-01 11:38:52 -05:00
Daniel G. Taylor
f72cd13448 fix(high): load schema.Examples into []any 2022-11-29 13:59:52 -05:00
Daniel G. Taylor
f32132fbc9 fix: conditionally set min/max/multiple 2022-11-29 09:29:07 -05:00
Dave Shanley
c4b6e68197 Added prefixItems support to Schema. Fixes #2
prefixItems is a property of JSONSchema and supported by OpenAPI 3.1, this update adds support for `prefixItems` in low and high models. It's essentially a copy of the `items` property, but allows seperate configuration of both, without combining them and muddling things for clarity.

Signed-off-by: Dave Shanley <dave@quobix.com>
2022-11-21 09:44:51 -05:00
Dave Shanley
5bd0d8de50 Bumping coverage on low level models after new feature.
Fixed borked test
2022-11-18 11:00:34 -05:00
Travis Newhouse
7d68d4f589 Add GoLow method to high-level SchemaProxy
A client of high-level SchemaProxy may want to know whether a schema
is a reference and the name of the reference.  This information is
available from methods GetSchemaReference() and IsSchemaReference()
in low-level SchemaProxy.  Provide a GoLow() method to retrieve the
low-level SchemaProxy for a high-level SchemaProxy.
2022-10-25 12:55:22 -07:00
Dave Shanley
54316b4a00 Moved primitives to pointers in high-level schema.
A feature request from Travis Newhouse to make it easier to know which primitives have been set, and which have not. defaulting everything to 0 or false just doesn't work so well.
2022-10-25 07:23:02 -04:00
Dave Shanley
849074d0bc High-level base documentation is complete.
Examples and every model completed, 1/6th of the way through models.
2022-09-15 11:13:54 -04:00
Dave Shanley
b036982212 3.1 Support added to high models
webhooks and new multi-type models in place and coverage at 100%
2022-09-15 07:27:09 -04:00
Dave Shanley
d2b974829d Swagger v2 high model at 100% coverage. 2022-09-11 21:09:16 -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