Conversation
Introduces JSON-LD header generation and related types to the Rust template when enabled in config. Refactors struct generation to use the Derivative crate for custom Default implementations, and updates serde attributes to remove redundant defaults. Test expectations updated to reflect new struct derivations and attribute handling.
Introduces support for rendering the internal schema of a DataModel via a new Templates::Internal variant. Implements the render_internal_schema function to serialize the model as pretty-printed JSON.
Introduces a new test environment for Rust with JSON-LD code generation under tests/envs/rust-ld, including Dockerfile, Cargo.toml, and test suite. Updates GitHub Actions workflow to add a 'rust-ld' job for building and testing the new environment.
The test workflow now includes the '-O jsonld' flag when running the convert command, enabling JSON-LD output generation for improved testing coverage.
Added the 'derivative' crate version 2.2.0 to the Rust test environment dependencies.
Moved the uuid dependency above derive_builder for improved organization in the dependencies list.
Introduces a new test for Rust JSON-LD export in exporters.rs and adds the expected output file tests/data/expected_rust_ld.rs to verify correct rendering.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for generating Rust code with JSON-LD features and refines the handling of default values and serialization attributes in Rust struct generation. The changes add a new workflow to test Rust code generation with JSON-LD, update templates to support JSON-LD headers and contexts, and improve default value handling using the
derivativecrate. Supporting files and dependencies for the new JSON-LD environment are also included.Rust Code Generation and JSON-LD Support
rust-ld) to test Rust code generation with JSON-LD, including Docker setup and test execution. (.github/workflows/test.yml)templates/rust.jinja) [1] [2] [3] [4] [5] [6]Default Value Handling and Serialization Improvements
#[serde(default)]attributes with enhanced logic using thederivativecrate to provide more accurate default value handling for struct fields, reflected in generated test files. (templates/rust.jinja,tests/data/expected_rust.rs,tests/data/expected_rust_forbidden.rs) [1] [2] F1419f02L14R15)Environment and Dependency Setup for JSON-LD Testing
.gitignore,Cargo.tomlwith required dependencies (derivative,uuid, etc.), and a Dockerfile for building and testing. (tests/envs/rust-ld/.gitignore,tests/envs/rust-ld/Cargo.toml,tests/envs/rust-ld/Dockerfile) [1] [2] [3]