Repository navigation
openapi-codegen: emit complete manifests and require all three language gates - #67
Open
chrischeng-c4 wants to merge 1 commit into
Open
chrischeng-c4 wants to merge 1 commit into
chrischeng-c4 wants to merge 1 commit into
Conversation
…, and dependencies Record OpenAPI document SHA-256, generator version, and optional caller-supplied service compatibility label in GenerationManifest (schema_version 2). Expose with_service_compatibility on GenOptions, rejecting empty or whitespace labels before generation with typed ServiceCompatibilityError. Populate runtime_dependencies for TypeScript target profile with @tanstack/react-query and axios, asserting full coverage of emitted third-party imports with a negative control. Move target-dependency-manifest to Supported in STATUS.md and update ROADMAP.md.
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.
Closes #35
Summary of Changes
Implements the manifest provenance and runtime dependency requirements for issue #35 in
crates/openapi-codegen:GenerationManifestProvenance & Version:openapi_sha256: String,generator_version: String, andservice_compatibility: Option<String>.schema_versionto2.sha2(0.10.x, default-features = false) incrates/openapi-codegen/Cargo.tomlmatching workspaceCargo.lock.GenOptionsConfiguration & Validation:with_service_compatibility(label)and getterservice_compatibility().ServiceCompatibilityError::EmptyOrWhitespace.try_with_service_compatibility(label)helper for immediate typed validation.GeneratedOutputIn-Memory Provenance:spec_jsonbytes and caller compatibility label onGeneratedOutputduringgenerate/generate_for_target.manifest()purely from in-memory results without filesystem reads or log/spec leakage.runtime_dependenciesto include@tanstack/react-queryandaxios.pydantic>=2), TypeScript (@tanstack/react-query,axios), and Rust (reqwest,serde,serde_json).target-dependency-manifestincrates/openapi-codegen/STATUS.mdfromLimitedtoSupported.complete-target-dependency-manifestincrates/openapi-codegen/ROADMAP.md.Local Validation Results
Affected Isolated Unit Tests (PASSED):
cargo test --locked -p openapi-codegen --lib tests::output(8 passed, 0 failed):materialized_output_writes_a_versioned_contract_manifest: passedmanifest_records_sha256_of_spec_bytes_and_detects_one_byte_change: passed (same bytes give same SHA; one-byte change gives different SHA)manifest_carries_service_compatibility_label_verbatim: passedrejects_empty_or_whitespace_service_compatibility_label_before_generation: passedruntime_dependencies_cover_all_emitted_third_party_imports: passed (verifies all third-party imports in emitted Python, TypeScript, and Rust files are covered)negative_control_removing_runtime_dependency_fails_coverage_test_naming_dependency: passed (negative control confirms coverage failure names missing dependency)legacy_output_emits_no_manifest: passedrejects_escaping_output_before_writing_anything: passedcargo test --locked -p openapi-codegen --lib tests::generation(7 passed)cargo test --locked -p openapi-codegen --lib tests::target_profile(4 passed)Negative Control:
tests::output::negative_control_removing_runtime_dependency_fails_coverage_test_naming_dependencyexplicitly removes dependencies (axios,pydantic,reqwest) and verifies the coverage checker fails with the exact missing dependency named.Static Analysis & Formatting:
cargo fmt --check --manifest-path crates/openapi-codegen/Cargo.tomlpassed cleanly.cargo clippy --locked -p openapi-codegen --all-targets -- -D warningspassed with 0 warnings.Cloud CI Requirements
tsc,py_compile), and cross-language profile matrices (tests/it/) belong in authorized cloud CI.