graphql-engine/v3/crates/open-dds/Cargo.toml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
995 B
TOML
Raw Normal View History

[package]
name = "open-dds"
version.workspace = true
edition.workspace = true
license.workspace = true
[lib]
bench = false
[dependencies]
Remove duplicate JSON Schema entries (#692) <!-- Thank you for submitting this PR! :) --> ## Description When we generate a JSON schema via `schemars`, we end up with duplicate types in the schema, which get names like `ValueExpression2`, `Role2`, and so on. This isn't ideal, and seems to arise for two reasons: 1. The type is polymorphic, and is monomorphised in two ways, and thus the types can't be unified. 2. The type is monomorphic, but is used inside and outside of its home module. The first problem was fixed previously by splitting polymorphic types, but the second has proven to be a bit more work. This PR finally solves the problem by introducing a new library, `jsonschema-tidying`: * First, we search the definitions within the JSON schema for any whose names end in a number, such as `ValueExpression2` or `MetadataV2`. * Then, we look for types whose names match everything up to the final numeric digits, and discard any types for whom we can't find a match (so we keep `ValueExpression2` because `ValueExpression` exists, but discard `MetadataV2` because `MetadataV` does not). * Next, we remove the duplicate definition from the definitions map, potentially breaking links in both the schema _and_ the rest of the definitions map. * Finally, we traverse the entirety of the tree looking for any references to the duplicate entry, and replace them with references to the original entry. This PR has no direct user-facing change, however it _will_ have an effect on the docs generation code, which will hopefully result in tidier documentation. <!-- Questions to consider answering: 1. What user-facing changes are being made? 4. What are issues related to this PR? (Consider adding `(close #<issue-no>)` to the PR title) 5. What is the conceptual design behind this PR? 6. How can this PR be tested/verified? 7. Does the PR have limitations? 8. Does the PR introduce breaking changes? --> ## Changelog - Add a changelog entry (in the "Changelog entry" section below) if the changes in this PR have any user-facing impact. See [changelog guide](https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide). - If no changelog is required ignore/remove this section and add a `no-changelog-required` label to the PR. ### Product _(Select all products this will be available in)_ - [ ] community-edition - [ ] cloud <!-- product : end : DO NOT REMOVE --> ### Type <!-- See changelog structure: https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide#structure-of-our-changelog --> _(Select only one. In case of multiple, choose the most appropriate)_ - [ ] highlight - [x] enhancement - [x] bugfix - [ ] behaviour-change - [ ] performance-enhancement - [ ] security-fix <!-- type : end : DO NOT REMOVE --> ### Changelog entry <!-- - Add a user understandable changelog entry - Include all details needed to understand the change. Try including links to docs or issues if relevant - For Highlights start with a H4 heading (#### <entry title>) - Get the changelog entry reviewed by your team --> _Replace with changelog entry_ <!-- changelog-entry : end : DO NOT REMOVE --> <!-- changelog : end : DO NOT REMOVE --> V3_GIT_ORIGIN_REV_ID: fe73acf7d9df0b9867852e673e53cb086e3725d3
2024-06-11 11:27:42 +03:00
jsonschema-tidying = { path = "../utils/jsonschema-tidying" }
opendds-derive = { path = "../utils/opendds-derive" }
derive_more = { workspace = true }
indexmap = { workspace = true, features = ["serde"] }
ndc-models = { workspace = true }
Add support for multiple versions of ndc-spec to Open DD and metadata-resolve (#781) This PR introduces support for multiple versions of the ndc-spec by adding a new `VersionedSchemaAndCapabilities` enum variant under the `DataConnectorLink` in OpenDD. This allows the capture of both ndc v0.1.* and v0.2.* schema and capabilities. This is achieved by referencing the `ndc-models` crate twice, once for `v0.1.4` and once for the first commit after `v0.1.4`. That commit was chosen to avoid actual v0.2.0 breaking changes for now, while we lay in this multiple version support plumbing. Future PRs will use a newer commit and adopt the breaking changes where necessary. The `VersionedSchemaAndCapabilities::V02` variant uses the the v0.2 reference of `ndc-models`. Then, during metadata resolve, when we resolve the `DataConnectorContext` from `DataConnectorLink`, we perform a migration of v0.1 types to v0.2 types and store and use the v0.2 types during metadata resolve. This migration is performed in the new module `ndc_migration`. We also record the `NdcVersion` (either `V01` or `V02`) in the `DataConnectorLink`. The `execute` crate will need to use this to determine which version to send to the connector at runtime (to be implemented in a future PR). The new changes to OpenDD are hidden from the JSON Schema via a new `UnstableFeatures` flag, and the use of the new variant is gated behind it in metadata resolve, since we don't yet support it upstream in the `execute` crate. V3_GIT_ORIGIN_REV_ID: d6d8a768ea3537c0b5e620799e94d3dd1e529526
2024-06-28 14:56:52 +03:00
ndc-models-v01 = { workspace = true }
ref-cast = { workspace = true }
schemars = { workspace = true, features = ["smol_str", "preserve_order"] }
serde = { workspace = true }
serde_json = { workspace = true, features = ["preserve_order"] }
serde_path_to_error = { workspace = true }
smol_str = { workspace = true }
strum = { workspace = true }
strum_macros = { workspace = true }
thiserror = { workspace = true }
[dev-dependencies]
goldenfile = { workspace = true }
pretty_assertions = { workspace = true }
[package.metadata.cargo-machete]
ignored = [
"strum", # used by strum_macros
]
[lints]
workspace = true