Commit Graph

42 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
5d717bdefe Changed document signatures to use error instead of []error
Also removed old swagger `CreateDocument` method that has been deprecated.

Signed-off-by: quobix <dave@quobix.com>
2023-10-24 12:31:47 -04:00
quobix
198a47153b Added logic to ensure minumum and maximum are printed correctly.
If they are zero, but they are defined then do the right thing!

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
Tristan Cartledge
58433a6ffc fix: add missing const value to schema 2023-09-13 06:13:09 -04:00
Dave Shanley
c6388607bc Fixed high-level model handling of unevaluatedProperties #145
`unevaluatedProperties` was not being handled correctly by the high-level v3 schema. When being rendered down for validation, the correct type on the dynamic value was not being set correctly. This has been resolved without any change in coverage or needing new tests.

Signed-off-by: Dave Shanley <dave@quobix.com>
2023-07-21 11:38:19 -04:00
Derrick J. Wippler
9e487a8c49 fix: mutex now convers writes to ValueReference if they happen 2023-06-30 13:08:37 -04:00
Derrick J. Wippler
f77a8f6f2a fix: eliminated race condition, buildProps() no longer needs to be async 2023-06-30 13:08:37 -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
0cdd99e257 Fixed some primitive handling issues
Discovered when upgrading vacuum and deeper integration with libopenapi and performing hundreds more tests.

Signed-off-by: Dave Shanley <dave@quobix.com>
2023-04-30 09:01:15 -04:00
Dave Shanley
26e694a5e9 Updated embedded OAS schemas and fixed UniqueValues
UniqueValues was marked as an integer, not a boolean.

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
0e44dc90b5 Working through coverage on node builder. 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
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
5f92de63a4 fix: remove debug logging 2023-01-10 17:39:03 -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
16c841fc30 (fix): ReadOnly and WriteOnly de-pointed #30
@TristanSpeakEasy: "ReadOnly/WriteOnly are *bool but could be simplified to bool as they default to false always. It is always a bit awkward in Golang to work with pointers and if possible its great to avoid them especially when the absence of a value in the yaml/json doc defaults to false"

Done.
2022-12-01 08:48:37 -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
44b219a023 Fixed resolving bug with polymorphic schemas.
Multiple polymorphic, deeply embedded schemas cause resolving issues as a channel waits forever due to a counting issue.

This has been resolved.

Signed-off-by: Dave Shanley <dshanley@splunk.com>
2022-11-11 13:07:38 -05:00
Dave Shanley
54d924d46d Enums in Schema are now interface{} types in datamodel #1
Addressing issues #1, Enums can be anything and should not be consideded plain strings.
2022-10-27 06:51:37 -04: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
19269af7d7 Added support for 3.1 updates to schema 2022-09-14 11:16: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