Add major version level to namespace hierarchy - #208
Merged
Conversation
When a union property (e.g. Schema|any) was normalized to a parent entity, ApplyUnionTypesStage applied the union interface to the common parent entity interface, but CreateUnionValueMethodsStage only generated method implementations on the leaf impl in the originating namespace. This caused compilation failures for sibling leaf impls that inherited the union interface but lacked the required methods (e.g. AsyncApi20-26 SchemaImpl missing asAny). The fix scopes the entity search by the property origin's namespace so that all leaf impls within the same spec tree receive the union methods. Also adds FullGeneratorTest which runs all four specs (OpenAPI, AsyncAPI, JSON Schema, OpenRPC) through the generator with compilation validation.
…SHOT Introduces a 4th level to the model hierarchy (Common -> Spec -> MajorVersion -> SpecVersion), allowing normalization to unify entities/traits within a major version before unifying across major versions. Adds majorVersionPrefix and majorVersionNamespace optional fields to SpecificationVersion schema. Updates all spec version YAML files with the new namespace structure. Fixes entity/trait normalization to recursively check descendant namespaces and propagate parent entities through registered-prefix namespaces. Fixes missing import in CreateWritersStage for regex property common types.
The maven-plugin module was missing an explicit maven-compiler-plugin declaration, causing it to fall back to source/target level 5 which is no longer supported by modern JDKs.
The IT pom.xml files relied on the default maven-compiler-plugin 3.1 which doesn't support the --release option needed for Java 17.
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.
Summary
Common -> Spec -> MajorVersion -> SpecVersion),enabling normalization to unify entities/traits within a major version before unifying across
major versions
majorVersionPrefixandmajorVersionNamespacefields to theSpecificationVersionschema and registers them inSpecificationIndexasyncapi.v20becomesasyncapi.v2x.v20)pass-through parent creation at registered-prefix namespaces when normalization has
already occurred at a lower level
CreateWritersStagefor regex property common entity typesCreateUnionValueMethodsStage) scoping for normalizedentity properties
FullGeneratorTestthat runs the generator against the full set of specs (OpenAPI,AsyncAPI, JSON Schema, OpenRPC) with compilation validation and golden manifest comparison
2.0.0-SNAPSHOTTest plan
GeneratorTestpasses (simple tests including parent-trait)FullGeneratorTestpasses (full spec generation, compilation, manifest)mvn verifyon maven-plugin-tests)